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 ¶
This section is empty.
Functions ¶
func InitRegexps ¶
InitRegexps initializes a list of compiled regular expressions.
Types ¶
type FileSource ¶
type FileStat ¶
type FileStat struct { Fileinfo os.FileInfo /* the file info */ Return chan int64 /* the harvester will send an event with its offset when it closes */ LastIteration uint32 /* int number of the last iterations in which we saw this file */ }
Contains statistic about file when it was last seend by the prospector
type Harvester ¶
type Harvester struct { Path string /* the file path to harvest */ ProspectorConfig config.ProspectorConfig Config *config.HarvesterConfig Stat *FileStat SpoolerChan chan *input.FileEvent ExcludeLinesRegexp []*regexp.Regexp IncludeLinesRegexp []*regexp.Regexp // contains filtered or unexported fields }
func NewHarvester ¶
func NewHarvester( prospectorCfg config.ProspectorConfig, cfg *config.HarvesterConfig, path string, stat *FileStat, spooler chan *input.FileEvent, ) (*Harvester, error)
type LogSource ¶
type LogSource interface { io.ReadCloser Name() string }
Click to show internal directories.
Click to hide internal directories.