Documentation
¶
Overview ¶
Package logs supplies the logs profile for ZedSearch's WAL-backed indexes.
Index ¶
- func ApplyDefaults(mappings *meta.Mappings) error
- func CheckWindow(event, now time.Time, upto, future time.Duration) error
- func EventTime(doc map[string]interface{}, mappings *meta.Mappings, now time.Time) (time.Time, error)
- func Normalize(doc map[string]interface{}, mappings *meta.Mappings, now time.Time) (map[string]interface{}, time.Time, error)
- func ParseHEC(body []byte) ([]map[string]interface{}, error)
- func ParseJSON(body []byte) ([]map[string]interface{}, error)
- func ParseLoki(body []byte) ([]map[string]interface{}, error)
- func ParseOTLP(body []byte) ([]map[string]interface{}, error)
- func SeverityText(number int) string
- func ValidateMappings(mappings *meta.Mappings) error
- type IngestResponse
- type StreamStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDefaults ¶
ApplyDefaults adds log search fields without replacing explicit mappings.
func CheckWindow ¶ added in v1.3.0
CheckWindow rejects events older than upto or later than future relative to now, like OpenObserve's ZO_INGEST_ALLOWED_UPTO/ZO_INGEST_ALLOWED_IN_FUTURE. A zero bound is disabled.
func EventTime ¶ added in v1.3.0
func EventTime(doc map[string]interface{}, mappings *meta.Mappings, now time.Time) (time.Time, error)
EventTime returns the UTC event time Normalize would write, now when doc has none, without copying doc.
func Normalize ¶
func Normalize(doc map[string]interface{}, mappings *meta.Mappings, now time.Time) (map[string]interface{}, time.Time, error)
Normalize returns a shallow copy with canonical UTC event time. The caller's fields, including message/log and the original _timestamp alias, are preserved. The date format/time_zone of the mapping for the field actually used applies.
func ParseHEC ¶ added in v1.3.0
ParseHEC decodes Splunk HTTP Event Collector events, which may be concatenated or newline-delimited. The per-event `index` is ignored: events go to the index in the request path.
func ParseJSON ¶ added in v1.3.0
ParseJSON decodes an log `_json` body: an array of objects, or one object.
func ParseLoki ¶ added in v1.3.0
ParseLoki decodes a Loki push API JSON body. Labels and structured metadata become fields; entries are [ "<unix ns>", "<line>", {metadata}? ].
func ParseOTLP ¶ added in v1.3.0
ParseOTLP decodes an OTLP/HTTP JSON logs request. Resource and record attributes keep their dotted keys (e.g. service.name), a string body becomes message and any other body is stored under body.
func SeverityText ¶ added in v1.3.0
SeverityText maps an OTLP SeverityNumber to a lowercase level, "" when unset.
func ValidateMappings ¶
Types ¶
type IngestResponse ¶ added in v1.3.0
type IngestResponse struct {
Code int `json:"code"`
Status []StreamStatus `json:"status"`
}
IngestResponse mirrors the log `_json`/`_multi` ingestion response.