harvester

package
v5.0.0-alpha5+incompat... Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2016 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

The harvester package harvest different inputs for new information. Currently two harvester types exist:

  • log
  • stdin

The log harvester reads a file line by line. In case the end of a file is found with an incomplete line, the line pointer stays at the beginning of the incomplete line. As soon as the line is completed, it is read and returned.

The stdin harvesters reads data from stdin.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileTruncate = errors.New("detected file being truncated")
	ErrRenamed      = errors.New("file was renamed")
	ErrRemoved      = errors.New("file was removed")
	ErrInactive     = errors.New("file inactive")
	ErrClosed       = errors.New("reader closed")
)

Functions

func MatchAnyRegexps

func MatchAnyRegexps(regexps []*regexp.Regexp, text string) bool

MatchAnyRegexps checks if the text matches any of the regular expressions

Types

type Harvester

type Harvester struct {
	// contains filtered or unexported fields
}

func NewHarvester

func NewHarvester(
	cfg *common.Config,
	state file.State,
	prospectorChan chan *input.Event,
	done chan struct{},
) (*Harvester, error)

func (*Harvester) Harvest

func (h *Harvester) Harvest()

Log harvester reads files line by line and sends events to the defined output

type LogFile

type LogFile struct {
	// contains filtered or unexported fields
}

func NewLogFile

func NewLogFile(
	fs source.FileSource,
	config harvesterConfig,
	done chan struct{},
) (*LogFile, error)

func (*LogFile) Read

func (r *LogFile) Read(buf []byte) (int, error)

Directories

Path Synopsis
Package reader provides interface and struct to read messages and report them to a harvester The interface used is: type Reader interface { Next() (Message, error) } Each time Next is called on a reader, a Message object is returned.
Package reader provides interface and struct to read messages and report them to a harvester The interface used is: type Reader interface { Next() (Message, error) } Each time Next is called on a reader, a Message object is returned.

Jump to

Keyboard shortcuts

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