github.com/honeycombio/honeytail@v1.9.0/parsers/parsers.go (about)

     1  // Package parsers provides an interface for different log parsing engines.
     2  //
     3  // Each module in here takes care of a specific log type, providing
     4  // any necessary or relevant smarts for that style of logs.
     5  package parsers
     6  
     7  import "github.com/honeycombio/honeytail/event"
     8  
     9  type Parser interface {
    10  	// Init does any initialization necessary for the module
    11  	Init(options interface{}) error
    12  	// ProcessLines consumes log lines from the lines channel and sends log events
    13  	// to the send channel. prefixRegex, if not nil, will be stripped from the
    14  	// line prior to parsing. Any named groups will be added to the event.
    15  	ProcessLines(lines <-chan string, send chan<- event.Event, prefixRegex *ExtRegexp)
    16  }
    17  
    18  type LineParser interface {
    19  	ParseLine(line string) (map[string]interface{}, error)
    20  }