<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>A newbie question: Is it possible to use values
matching a regular expression in a comparison?<br>
<br>
Imagine I receive messges like this: "Disk usage is 60%", "Disk
usage is 80%", etc. All match the regular expression "Disk usage is
[0-9]+%". I do not want to log all these messages, but only those where
disk usage is at least 75 per cent.<br>
Can this be achieved by proper configuration?<br>
Where to look in the documentation?<br>
<br>
<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>Currently I am stuck with this approch:<br>
parser p_disk {<br>
csv-parser(columns("fix.disk","fix.usage",
"fix.is", "diskusage")<br>
delimiters(" %")<br>
);<br>
};<br>
filter f_disk_syntax {<br>
message("Disk usage is [0-9]+%");<br>
};<br>
filter f_disk_usage { "$diskusage" > "75" };<br>
log l_mylog {<br>
source(...);<br>
filter(f_disk_syntax);<br>
parser(p_disk);<br>
filter(f_disk_usage);<br>
destination(...);<br>
};<br>
<br>
Is this a useful approach? Can it be accomplished with fewer definitions?<br>
The definition of f_disk_usage results in a syntax error. What would be the
right syntax?<br>
filter f_disk_usage { "$diskusage" > "75" };<br>
filter f_disk_usage { "$diskusage" ge "75" };<br>
filter f_disk_usage { value("diskusage") > "75" };<br>
filter f_disk_usage { "$diskusage" > 75};<br>
filter f_disk_usage { "${diskusage}" > "75" };<br>
filter f_disk_usage { ${diskusage} > "75" };<br>
<br>
Will I need to set up a pattern database to get rid of all unwanted messages?<br>
<br>
Thank you<br>
Roland<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>