Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Process ¶
func Process(rules []Rules, rd io.Reader, f HandleFunc) error
Process extracts all log messages from the reader, ignores those matched by the rules and hands the remaining lines to f. When f returns an error, processing stops and this error is returned. Empty lines are always ignored.
Types ¶
type Config ¶
Config holds all information parsed from a configuration file.
func ParseConfig ¶
ParseConfig parses data as an erpel config file.
func ParseConfigFile ¶
ParseConfigFile loads a config from a file.
type Field ¶
Field is a dynamic section in a log message.
type HandleFunc ¶
HandleFunc handles lines than have not been filtered out by any rules.
type Marker ¶
Marker is a position within a file.
func ProcessFile ¶
ProcessFile extracts all log messages starting at the marker from the file by opening it and calling Process(). Returned is a marker for the last position within the file.
type RuleView ¶
RuleView is the semantic representation of a rule, constructed by replacing all fields in a template.
type Rules ¶
type Rules struct { Prefix string Fields map[string]Field GlobalFields map[string]Field Templates []string Samples []string // contains filtered or unexported fields }
Rules holds all information parsed from a rules file.
func ParseAllRulesFiles ¶
ParseAllRulesFiles loads rules from all files in the directory.
func ParseRules ¶
ParseRules parses the data as an erpel rule file.
func ParseRulesFile ¶
ParseRulesFile loads rules from a file and parses it.
func (*Rules) Check ¶
Check runs self-tests on the Rules, it returns an error if a message in the samples section is not matched by the rules.