Re: discussion: Should ptbtool test validate types

Balazs Scheidler <[email protected]> Sat, 19 Aug 2023 23:12:18 +0200
Newsgroups gmane.comp.syslog-ng
Message-ID <CAKcfE+ZqhA13hGDmWzdNon3_nAHg9+DNQ-R8v-2PptuA+DhUeg@mail.gmail.com>
You are right it should do that. Can you open an issue?

On Fri, Aug 18, 2023, 16:53 Evan Rempel <[email protected]> wrote:

> Now that syslog-ng has type hinting should the pdbtool test also validate
> the types of any values specified for a pattern.
>
>
> <rule id="pid1" class="myclass" provider="me">
>     <patterns>
>         <pattern>some pattern @NUMBER:mynum@ with number</pattern>
>     </patterns>
>     <tags>
>         <tag>rate</tag>
>     </tags>
>     <values>
>        <value name="more" type="integer">100A</value>
>     </values>
>     <examples>
>        <example>
>           <test_message program="some pattern 123 with number
> </test_message>
>           <test_values>
>              <test_value name="mynum" type="integer">123</test_value>
>           </test_values>
>        </example>
>     </examples>
> </rule>
>
>
> Currently the test_values are verified for both the value, and the type
> that the pattern parses, however, none of the values that are used to
> enrich this message are verified for type.
>
> This results in a patterndb that passes validation, yet will fail at the
> time the pattern matches a log message.
>
>
> comments?
>
> --
> 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
>
>

______________________________________________________________________________
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