AutoPatrol, Bureaucrats, Administrators
683
edits
m (→Macros) |
|||
Line 79: | Line 79: | ||
Example: you need to parse log file where each line starts with timestamp in format dd/mm/yy HH:MM:SS. You can define the following macro: | Example: you need to parse log file where each line starts with timestamp in format dd/mm/yy HH:MM:SS. You can define the following macro: | ||
< | <syntaxhighlight lang="xml"> | ||
<macro name="timestamp">[0-9]{2}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}</macro> | <macro name="timestamp">[0-9]{2}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}</macro> | ||
</ | </syntaxhighlight> | ||
and then use it in matching rules: | and then use it in matching rules: | ||
< | <syntaxhighlight lang="xml"> | ||
<rules> | <rules> | ||
<rule> | <rule> | ||
Line 96: | Line 96: | ||
</rule> | </rule> | ||
</rules> | </rules> | ||
</ | </syntaxhighlight> | ||
Please note that <nowiki><macros></nowiki> section always should be located before <nowiki><rules></nowiki> section in parser definition file. | Please note that <nowiki><macros></nowiki> section always should be located before <nowiki><rules></nowiki> section in parser definition file. |