Documentation ¶
Index ¶
- func NewLineEndSplitFunc(re *regexp.Regexp) bufio.SplitFunc
- func NewLineStartSplitFunc(re *regexp.Regexp) bufio.SplitFunc
- func NewNewlineSplitFunc(encoding encoding.Encoding) (bufio.SplitFunc, error)
- func ReadToEnd(ctx context.Context, path string, startOffset int64, lastSeenFileSize int64, ...) error
- type InputConfig
- type InputOperator
- type MultilineConfig
- type PositionalScanner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLineEndSplitFunc ¶
NewLineEndSplitFunc creates a bufio.SplitFunc that splits an incoming stream into tokens that end with a match to the regex pattern provided
func NewLineStartSplitFunc ¶
NewLineStartSplitFunc creates a bufio.SplitFunc that splits an incoming stream into tokens that start with a match to the regex pattern provided
func NewNewlineSplitFunc ¶
NewNewlineSplitFunc splits log lines by newline, just as bufio.ScanLines, but never returning an token using EOF as a terminator
func ReadToEnd ¶
func ReadToEnd( ctx context.Context, path string, startOffset int64, lastSeenFileSize int64, messenger fileUpdateMessenger, splitFunc bufio.SplitFunc, filePathField entry.Field, fileNameField entry.Field, inputOperator helper.InputOperator, maxLogSize int, encoding encoding.Encoding, ) error
ReadToEnd will read entries from a file and send them to the outputs of an input operator
Types ¶
type InputConfig ¶
type InputConfig struct { helper.InputConfig `yaml:",inline"` Include []string `json:"include,omitempty" yaml:"include,omitempty"` Exclude []string `json:"exclude,omitempty" yaml:"exclude,omitempty"` PollInterval operator.Duration `json:"poll_interval,omitempty" yaml:"poll_interval,omitempty"` Multiline *MultilineConfig `json:"multiline,omitempty" yaml:"multiline,omitempty"` IncludeFileName bool `json:"include_file_name,omitempty" yaml:"include_file_name,omitempty"` IncludeFilePath bool `json:"include_file_path,omitempty" yaml:"include_file_path,omitempty"` StartAt string `json:"start_at,omitempty" yaml:"start_at,omitempty"` MaxLogSize int `json:"max_log_size,omitempty" yaml:"max_log_size,omitempty"` Encoding string `json:"encoding,omitempty" yaml:"encoding,omitempty"` }
InputConfig is the configuration of a file input operator
func NewInputConfig ¶
func NewInputConfig(operatorID string) *InputConfig
func (InputConfig) Build ¶
func (c InputConfig) Build(context operator.BuildContext) (operator.Operator, error)
Build will build a file input operator from the supplied configuration
type InputOperator ¶
type InputOperator struct { helper.InputOperator Include []string Exclude []string FilePathField entry.Field FileNameField entry.Field PollInterval time.Duration SplitFunc bufio.SplitFunc MaxLogSize int // contains filtered or unexported fields }
InputOperator is an operator that monitors files for entries
func (*InputOperator) Start ¶
func (f *InputOperator) Start() error
Start will start the file monitoring process
func (*InputOperator) Stop ¶
func (f *InputOperator) Stop() error
Stop will stop the file monitoring process
type MultilineConfig ¶
type MultilineConfig struct { LineStartPattern string `json:"line_start_pattern" yaml:"line_start_pattern"` LineEndPattern string `json:"line_end_pattern" yaml:"line_end_pattern"` }
MultilineConfig is the configuration a multiline operation
type PositionalScanner ¶
func NewPositionalScanner ¶
func (*PositionalScanner) Pos ¶
func (ps *PositionalScanner) Pos() int64