pdbtool validate now requires type information.

Evan Rempel <[email protected]> Tue, 28 Mar 2023 10:01:20 -0700
Newsgroups gmane.comp.syslog-ng
Message-ID <[email protected]>
I'm working with syslog-ng-4.1.1-1 and attempting to validate a 
patterndb xml file.

I understand that the pattern parsers will produce type aware values, 
but it seems that if the tests in the patterndb xml file do not contain 
any type information that all tests against non-string values will fail.

Is that intended behavior to require type information on all tests?

If that is by design I propose that this makes thing difficult because 
@NUMBER:var@ and @STRING:var@ will both successfully parse the same 
value out of the syslog message, but the test would now have to be 
different. Tools that programmatically produce the patterndb need to 
become a lot smarter.

Can anyone comment on this behavior?

When attempting to validate the attached patterndb.xml file I get the error

Testing message: program='xinetd' message='EXIT: gsiftp status=0 
pid=23133 duration=0(sec)'
  Wrong match name='status', value='0', type='integer', expected='0', 
expected_type='string'
  Wrong match name='sec', value='0', type='integer', expected='0', 
expected_type='string'
  Wrong match name='pid', value='23133', type='integer', 
expected='23133', expected_type='string'


-- 
Evan

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq
patterndb.xml (text/xml, 1.2 KB)
<patterndb version="4" pub_date="2009-09-01">
   <ruleset name="xinetd" id="RS-e17651c7-42fe-43be-8a9a-cb36d1a25fcd">
      <pattern>xinetd</pattern>
      <rules>
         <rule id="FLARE-3264" class="xinetd" provider="UVic">
            <patterns>
               <pattern>EXIT: @ESTRING:command: status=@@NUMBER:status@ pid=@NUMBER:pid@ duration=@NUMBER:sec@(sec)</pattern>
            </patterns>
            <tags>
               <tag>ignore</tag>
            </tags>
            <values>
               <value name="AUTHPROGRAM">xinetd</value>
               <value name="PATTERNID">3264</value>
            </values>
            <examples>
               <example>
                  <test_message program="xinetd">EXIT: gsiftp status=0 pid=23133 duration=0(sec)</test_message>
                  <test_values>
                     <test_value name="status">0</test_value>
                     <test_value name="sec">0</test_value>
                     <test_value name="command">gsiftp</test_value>
                     <test_value name="pid">23133</test_value>
                  </test_values>
               </example>
            </examples>
         </rule>
      </rules>
   </ruleset>
</patterndb>