multiline

package
v0.0.0-...-8a6c391 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiLine

type MultiLine struct {
	LastTouched time.Time
	// contains filtered or unexported fields
}

MultiLine processor combining multiple line events into one multi-line event.

Lines to be combined are matched by some configurable predicate using regular expression.

The maximum number of lines to be returned is fully configurable. Even if limits are reached subsequent lines are matched, until event is fully finished.

func NewMultiLine

func NewMultiLine(config *MultilineConfig) (MultiLine, error)

NewMultiLine creates a new multi-line processor combining stream of line events into stream of multi-line events.

func (*MultiLine) Buffer

func (ml *MultiLine) Buffer(next *router.Message) *router.Message

Adds a message to the MultiLine buffer, returning a flushed message if one is ready

func (*MultiLine) Expire

func (ml *MultiLine) Expire(t time.Time, ttl time.Duration) *router.Message

func (*MultiLine) Flush

func (ml *MultiLine) Flush() *router.Message

func (*MultiLine) PendingSize

func (ml *MultiLine) PendingSize() int

func (*MultiLine) StartNewLine

func (ml *MultiLine) StartNewLine(next *router.Message) *router.Message

type MultilineConfig

type MultilineConfig struct {
	Pattern   *regexp.Regexp `config:"pattern"     validate:"required"`
	GroupWith string         `config:"match"       validate:"required"`
	Negate    bool           `config:"negate"`
	Separator *string        `config:"separator"`
	MaxLines  int            `config:"max_lines"`
}

Jump to

Keyboard shortcuts

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