Difference between revisions of "UM:Log Monitoring"

36 bytes added ,  13:19, 2 April 2012
m
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:


<source lang="xml">
<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>
</source>
</syntaxhighlight>


and then use it in matching rules:
and then use it in matching rules:


<source lang="xml">
<syntaxhighlight lang="xml">
<rules>
<rules>
<rule>
<rule>
Line 96: Line 96:
</rule>
</rule>
</rules>
</rules>
</source>
</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.
683

edits