[syslog-ng] Small problem with pdbtool and the parser ?

Ilas, Yann yann.ilas at eads.com
Wed Jul 28 15:39:41 CEST 2010


Hello,

I have a small problem with pdbtool. When I try to match this message "> Message message n°2 message 255", I obtain this error : "Error parsing command line arguments: Invalid byte sequence in conversion input".
The problem seems to be the "°" which is bad interpreted by pdbtool. But the syslog-ng application has not that problem.

Here is the xml file I used :
<?xml version='1.0' encoding='UTF-8'?>
<patterndb version='3' pub_date='2010-07-28'>
  <ruleset name='test' id='ab-cd-123456789'>
    <pattern>test</pattern>
    <rules>
      <rule provider='yann' id='xxxxx:syslog:abcdef:1234567890:id001' class='system'>
      <patterns>
         <pattern>&gt; Message message n°@NUMBER@ message @NUMBER@</pattern>
         <values>
           <value name=".classifier.facility">local5</value>
           <value name=".classifier.severity">notice</value>
           <value name=".classifier.priority">173</value>
         </values>
      </patterns>
      </rule>
    </rules>
  </ruleset>
</patterndb>

If I use the pattern "<pattern>&gt; Message message n°@NUMBER@ message @NUMBER@</pattern>", I obtain :
  $ /opt/syslog-ng/bin/pdbtool match -p patterndb.xml -P test -M '> Message message n°2 message 255'
  Error parsing command line arguments: Invalid byte sequence in conversion input
=> It's not OK

If I use the pattern "<pattern>&gt; Message message nx at NUMBER@ message @NUMBER@</pattern>", I obtain :
(the diffence is the charactere "x" after the " n")
  $ /opt/syslog-ng/bin/pdbtool match -p patterndb.xml -P test -M '> Message message nx2 message 255'
  MESSAGE=> Message message nx2 message 255
  PROGRAM=test
  .classifier.class=system
  .classifier.rule_id=xxxxx:syslog:abcdef:1234567890:id001
  .classifier.facility=local5
  .classifier.severity=notice
  .classifier.priority=173
=> It's OK

With syslog-ng and the pattern "<pattern>&gt; Message message n°@NUMBER@ message @NUMBER@</pattern>", I tried to send the same message (with the "°") by using "nc" and it works, ie the message is well interpreted by the application :
  $ LANG=C date +"<70>%b %d %R:%S server.domain test[1234]: > Message message n°123 message 456" | nc -4 127.0.0.1 514

Why pdbtool can't parse that string ?

Regards,

Yann I.


More information about the syslog-ng mailing list