Documentation ¶
Index ¶
- Variables
- func GenDateParse(date string) (string, time.Time)
- func GeoIPASNInit(cfg map[string]string) (interface{}, error)
- func GeoIPCityInit(cfg map[string]string) (interface{}, error)
- func GeoIpASN(field string, p *types.Event, ctx interface{}, plog *log.Entry) (map[string]string, error)
- func GeoIpCity(field string, p *types.Event, ctx interface{}, plog *log.Entry) (map[string]string, error)
- func IpToRange(field string, p *types.Event, ctx interface{}, plog *log.Entry) (map[string]string, error)
- func IpToRangeInit(cfg map[string]string) (interface{}, error)
- func Parse(ctx UnixParserCtx, xp types.Event, nodes []Node) (types.Event, error)
- func ParseDate(in string, p *types.Event, x interface{}, plog *log.Entry) (map[string]string, error)
- func SetTargetByName(target string, value string, evt *types.Event) bool
- type EnrichFunc
- type Enricher
- type EnricherCtx
- type ExprWhitelist
- type InitFunc
- type Node
- type ParserResult
- type Parsers
- type Stagefile
- type UnixParserCtx
- type Whitelist
Constants ¶
This section is empty.
Variables ¶
View Source
var DumpFolder string
View Source
var NodesHits = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cs_node_hits_total", Help: "Total events entered node.", }, []string{"source", "type", "name"}, )
View Source
var NodesHitsKo = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cs_node_hits_ko_total", Help: "Total events unsuccessfully exited node.", }, []string{"source", "type", "name"}, )
View Source
var NodesHitsOk = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cs_node_hits_ok_total", Help: "Total events successfully exited node.", }, []string{"source", "type", "name"}, )
View Source
var ParseDump bool
View Source
var StageParseCache map[string]map[string][]ParserResult
View Source
var StageParseMutex sync.Mutex
Functions ¶
func GeoIPASNInit ¶
func GeoIPCityInit ¶
func IpToRangeInit ¶
Types ¶
type EnrichFunc ¶
should be part of a packaged shared with enrich/geoip.go
type Enricher ¶
type Enricher struct { Name string InitFunc InitFunc EnrichFunc EnrichFunc Ctx interface{} }
type EnricherCtx ¶
type ExprWhitelist ¶
type ExprWhitelist struct { Filter *vm.Program ExprDebugger *exprhelpers.ExprDebugger // used to debug expression by printing the content of each variable of the expression }
type Node ¶
type Node struct { FormatVersion string `yaml:"format"` //Enable config + runtime debug of node via config o/ Debug bool `yaml:"debug,omitempty"` //If enabled, the node (and its child) will report their own statistics Profiling bool `yaml:"profiling,omitempty"` //Name, author, description and reference(s) for parser pattern Name string `yaml:"name,omitempty"` Author string `yaml:"author,omitempty"` Description string `yaml:"description,omitempty"` References []string `yaml:"references,omitempty"` //if debug is present in the node, keep its specific Logger in runtime structure Logger *log.Entry `yaml:"-"` //This is mostly a hack to make writing less repetitive. //relying on stage, we know which field to parse, and we //can also promote log to next stage on success Stage string `yaml:"stage,omitempty"` //OnSuccess allows to tag a node to be able to move log to next stage on success OnSuccess string `yaml:"onsuccess,omitempty"` //Filter is executed at runtime (with current log line as context) //and must succeed or node is exited Filter string `yaml:"filter,omitempty"` RunTimeFilter *vm.Program `yaml:"-" json:"-"` //the actual compiled filter ExprDebugger *exprhelpers.ExprDebugger `yaml:"-" json:"-"` //used to debug expression by printing the content of each variable of the expression //If node has leafs, execute all of them until one asks for a 'break' LeavesNodes []Node `yaml:"nodes,omitempty"` //Flag used to describe when to 'break' or return an 'error' EnrichFunctions EnricherCtx /* If the node is actually a leaf, it can have : grok, enrich, statics */ //pattern_syntax are named grok patterns that are re-utilized over several grok patterns SubGroks yaml.MapSlice `yaml:"pattern_syntax,omitempty"` //Holds a grok pattern Grok types.GrokPattern `yaml:"grok,omitempty"` //Statics can be present in any type of node and is executed last Statics []types.ExtraField `yaml:"statics,omitempty"` //Stash allows to capture data from the log line and store it in an accessible cache Stash []types.DataCapture `yaml:"stash,omitempty"` //Whitelists Whitelist Whitelist `yaml:"whitelist,omitempty"` Data []*types.DataSource `yaml:"data,omitempty"` // contains filtered or unexported fields }
func LoadStages ¶
func LoadStages(stageFiles []Stagefile, pctx *UnixParserCtx, ectx EnricherCtx) ([]Node, error)
func (*Node) ProcessStatics ¶
type ParserResult ¶
type Parsers ¶
type Parsers struct { Ctx *UnixParserCtx Povfwctx *UnixParserCtx StageFiles []Stagefile PovfwStageFiles []Stagefile Nodes []Node Povfwnodes []Node EnricherCtx EnricherCtx }
func NewParsers ¶
func NewParsers() *Parsers
Return new parsers nodes and povfwnodes are already initialized in parser.LoadStages
type UnixParserCtx ¶
func Init ¶
func Init(c map[string]interface{}) (*UnixParserCtx, error)
Click to show internal directories.
Click to hide internal directories.