Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DrainCluster ¶
DrainCluster represents a discovered log template.
func MatchTemplate ¶
func MatchTemplate(line string, templates []DrainCluster) (DrainCluster, bool)
MatchTemplate finds the best matching template for a log line by comparing tokens against template patterns (where "<*>" is a wildcard). Returns the matched template and true, or zero-value and false if no match.
type DrainParser ¶
type DrainParser struct {
// contains filtered or unexported fields
}
DrainParser uses the Drain algorithm to discover log templates online.
func NewDrainParser ¶
func NewDrainParser() (*DrainParser, error)
NewDrainParser creates a DrainParser with default Drain parameters.
func (*DrainParser) Feed ¶
func (p *DrainParser) Feed(ctx context.Context, contents []string) error
Feed processes a batch of log lines through the Drain algorithm.
func (*DrainParser) Templates ¶
func (p *DrainParser) Templates(ctx context.Context) ([]DrainCluster, error)
Templates returns all Drain clusters discovered so far with their counts.
Click to show internal directories.
Click to hide internal directories.