AutoPatrol, Bureaucrats, Administrators
683
edits
m (→Macros) |
m (→Tag) |
||
Line 126: | Line 126: | ||
=== <match> Tag === | === <match> Tag === | ||
<nowiki>Tag <match> contains POSIX regular expression used to match log records. Parts enclosed in parenthesis can be extracted from log record and passed as arguments of generated event. You can use macros defined in <macros> section. Also, is is possible to define inverted match rules (rules when log </nowiki>record considered matching if it does not match regular expression). Inverted match can be set by setting attribute invert to 1. | <nowiki>Tag <match> contains POSIX regular expression used to match log records. Parts enclosed in parenthesis can be extracted from log record and passed as arguments of generated event. You can use macros defined in <macros> section. Also, is is possible to define inverted match rules (rules when log </nowiki>record considered matching if it does not match regular expression). Inverted match can be set by setting attribute invert to 1. | ||
Some examples: | Some examples: | ||
<syntaxhighlight lang="xml"> | |||
< | <match>^Error: (.*)</match> | ||
</syntaxhighlight> | |||
This regular expression will match any line started with word '''Error:''' , and everything after that word will be extracted from log record for use with event. | This regular expression will match any line started with word '''Error:''' , and everything after that word will be extracted from log record for use with event. | ||
< | <syntaxhighlight lang="xml"> | ||
<match>[0-9]{3}</match> | |||
</syntaxhighlight> | |||
This regular expression will match any line containing at least 3 consecutive digits. | This regular expression will match any line containing at least 3 consecutive digits. | ||
< | <syntaxhighlight lang="xml"> | ||
<match invert="1">abc</match> | |||
</syntaxhighlight> | |||
This regular expression will match any line not containing character sequence '''abc'''. | |||
=== <id> Tag === | === <id> Tag === |