Hi,
You are right. This was a bug in 3.38 which was fixed in PR #4158, which has already been merged to master, and I was testing with the current master and not 3.38.1
Even though I did that PR, I forgot we merged a fix for this already.
With the current master the same is like this:
$ bin/pdbtool test --validate sample.pdb
WARNING: the template specified in value()/<value> options for your grouping-by() or db-parser() configuration has been changed to support typing from syslog-ng 4.0. You are using an older config version and your template contains an unrecognized type-cast, probably a parenthesis in the value field. This will be interpreted in the `type(value)' format in future versions. Please add an explicit string() cast as shown in the 'fixed-value' tag of this log message or remove the parenthesis. The value will be processed as a 'string' expression; config-version='3.38', name='AUTHPROGRAM', value='su(pam_unix)', fixed-value='string(su(pam_unix))'
$ echo $?
0
The issue is that with the release of v4.0 (which we started to prepare for), this would become an error in earnest, as pdbtool does not allow you to specify the config version and uses the syslog-ng version number by default. And I don't see too much value in extending pdbtool in this direction, as having to add an explicit config version number to pdbtool when using it is not very intuitive.
The PR I mentioned in my previous email (#4222) improves this further by checking the pdb version field (in the topmost <patterndb> tag) and uses string based values if it's below v6.
What I am thinking about is whether to revert to using an attribute to specify the type, e.g.
<values>
<value
name="AUTHPROGRAM" type="whatevertype-syslog-ng-supports">su(pam_unix)</value>
</values>
We would default to using a string. The only downside is that add-contextual-data() uses the parenthesis based format in a CSV file and I can't extend the CSV format as easily as XML.
So by changing to the use of an attribute types would mean we have different syntaxes for these use-cases where one can use typed templates:
- config file anywhere: `type(value)`
- add-contextual-data, 3rd column in the CSV file: `type(value)`
- db-parser(): `<value name="foo" type="whatever"/>`