Documentation ¶
Index ¶
- Constants
- Variables
- func AcquisReadOneFile(ctx FileCtx, output chan types.Event, AcquisTomb *tomb.Tomb) error
- func AcquisStartReading(ctx *FileAcquisCtx, output chan types.Event, AcquisTomb *tomb.Tomb)
- func ReadAtOnce(ctx FileCtx, output chan types.Event, AcquisTomb *tomb.Tomb) error
- type Acquisition
- type FileAcquisCtx
- type FileCtx
Constants ¶
View Source
const ( TAILMODE = "tail" CATMODE = "cat" )
View Source
const ( FILETYPE = "file" BINTYPE = "bin" )
Variables ¶
View Source
var ReaderHits = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cs_reader_hits_total", Help: "Total lines where read.", }, []string{"source"}, )
Functions ¶
func AcquisReadOneFile ¶
A tail-mode file reader (tail)
func AcquisStartReading ¶
func AcquisStartReading(ctx *FileAcquisCtx, output chan types.Event, AcquisTomb *tomb.Tomb)
let's return an array of chans for signaling for now
Types ¶
type Acquisition ¶
type FileAcquisCtx ¶
func InitReader ¶
func InitReader(cfg string) (*FileAcquisCtx, error)
func InitReaderFromFileCtx ¶
func InitReaderFromFileCtx(files []FileCtx) (*FileAcquisCtx, error)
InitReader iterates over the FileCtx objects of cfg and resolves globbing to open files
func LoadAcquisitionConfig ¶ added in v0.1.4
func LoadAcquisitionConfig(cConfig *csconfig.CrowdSec) (*FileAcquisCtx, error)
type FileCtx ¶
type FileCtx struct { Type string `yaml:"type,omitempty"` //file|bin|... Mode string `yaml:"mode,omitempty"` //tail|cat|... Filename string `yaml:"filename,omitempty"` Filenames []string `yaml:"filenames,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` Profiling bool `yaml:"profiling,omitempty"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.