<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 12pt; color: #000000'>Hi to all.<br><br>We're using syslog-ng 3.2.4 and we're having a weird behaviour in using macros with actions values.<br><br>Here it is a sample pattern-db rule:<br><br><?xml version='1.0' encoding='UTF-8'?><br><patterndb version='4' pub_date='2011-06-20'><br> <ruleset name='cron' id='cron-ruleset'><br> <pattern>/usr/sbin/cron</pattern><br> <rules><br> <rule provider="patterndb" id="cron-1" class="system" context-id="sample-context-id"><br> <patterns><br> <pattern>(@ESTRING:usracct.username:) @CMD (@ESTRING:details:)@</pattern><br> </patterns><br> <actions><br> <action trigger="match" condition="match('mymatch' value('details'))"><br> <message><br> <values><br> <value name="MESSAGE">[${details}] was found in a cron log message. Rule number [${.classifier.rule_id}]</value><br> <value name="TRIGGER">yes</value><br> </values><br> </message><br> </action><br> </actions><br> </rule><br> </rules><br> </ruleset><br></patterndb><br><br>We tested the rule using pdtool match command and the output was:<br><br># pdbtool match -P "/usr/sbin/cron" -M "(root) CMD (mymatch)"<br>MESSAGE=(root) CMD (mymatch)<br>PROGRAM=/usr/sbin/cron<br>.classifier.class=system<br>.classifier.rule_id=cron-1<br>usracct.username=root<br>details=mymatch<br><br>HOST=<br>MESSAGE=[] was found in a cron log message. Rule number []<br>PROGRAM=/usr/sbin/cron<br>PID=<br>TRIGGER=yes<br><br>We instead expected the following output from pdtool match execution:<br><br># pdbtool match -P "/usr/sbin/cron" -M "(root) CMD (mymatch)"<br>
MESSAGE=(root) CMD (mymatch)<br>
PROGRAM=/usr/sbin/cron<br>
.classifier.class=system<br>
.classifier.rule_id=cron-1<br>
usracct.username=root<br>
details=mymatch<br>
<br>
HOST=<br>
MESSAGE=[mymatch] was found in a cron log message. Rule number [cron-1]<br>
PROGRAM=/usr/sbin/cron<br>
PID=<br>
TRIGGER=yes<br>
<br>Macro expansion was not executed in action values but it was in action definition... What are we missing?<br><br>Thank you in advance for your help<br><br>Denis Gasparin<br>---<br>Edistar SRL<br><br></div></body></html>