event

package
v0.0.0-...-332dcef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceFormatJSON      = "json"
	SourceFormatLogfmt    = "logfmt"
	SourceFormatKeyValue  = "key_value"
	SourceFormatPlainText = "plain_text"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Timestamp *time.Time        `json:"ts,omitempty"`
	Text      string            `json:"text"`
	Attrs     map[string]string `json:"attrs"`
	Inferred  *Inferred         `json:"inferred"`
}

Event mirrors the canonical v1 schema in proto/lapp/event/v1/event.proto.

type Fixture

type Fixture struct {
	Name         string `json:"name"`
	SourceFormat string `json:"source_format"`
	Description  string `json:"description"`
	Event        Event  `json:"event"`
}

Fixture mirrors the protobuf fixture contract for JSON-backed examples.

func LoadFixtures

func LoadFixtures(dir string) ([]Fixture, error)

LoadFixtures reads all JSON fixture files from a directory.

func (Fixture) Validate

func (f Fixture) Validate() error

Validate checks that the fixture satisfies the documented v1 contract.

type Inferred

type Inferred struct {
	Pattern string `json:"pattern,omitempty"`
	Entity  string `json:"entity,omitempty"`
}

Inferred contains metadata derived after parsing.

type ParsedLine

type ParsedLine struct {
	SourceFormat string
	Event        Event
}

ParsedLine is the normalized result of parsing a single raw log line.

func ParseLine

func ParseLine(line string) ParsedLine

ParseLine runs the default parser chain and always returns a normalized event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL