multiline

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingPattern = errors.New("multiline.pattern cannot be empty when pattern based matching is selected")
	ErrMissingCount   = errors.New("multiline.count cannot be empty when count based aggregation is selected")
)

Functions

func New

func New(
	r reader.Reader,
	separator string,
	maxBytes int,
	config *Config,
) (reader.Reader, error)

New creates a new multi-line reader combining stream of line events into stream of multi-line events.

Types

type Config

type Config struct {
	Type multilineType `config:"type"`

	Negate       bool           `config:"negate"`
	Match        string         `config:"match"`
	MaxLines     *int           `config:"max_lines"`
	Pattern      *match.Matcher `config:"pattern"`
	Timeout      *time.Duration `config:"timeout" validate:"positive"`
	FlushPattern *match.Matcher `config:"flush_pattern"`

	LinesCount  int  `config:"count_lines" validate:"positive"`
	SkipNewLine bool `config:"skip_newline"`
}

Config holds the options of multiline readers.

func DefaultConfig

func DefaultConfig(pattern string) *Config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the Config option for multiline reader.

Jump to

Keyboard shortcuts

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