[syslog-ng] is it possible to use if() ... else statements on syslog-ng 3.7?

Fabien Wernli wernli at in2p3.fr
Thu May 11 06:31:15 UTC 2017


On Wed, May 10, 2017 at 10:34:19PM -0700, Evan Rempel wrote:
> $(padding <macro> <prepended characters>)
> 
> but the examples show a length argument
> 
> $(padding $MESSAGE 10 X): bar
> would produce a result of XXXXXXXbar

I think the doc is somewhat wrong.
Here's what we use for example in our patterndb:

    <value name='hpss.msg_id'>${hpss.subsystem}$(padding "${hpss.message_num}" "4" "0")</value>

And in the example:

          hpss.subsystem: 'PVLS'
          hpss.message_num: '100'
          hpss.msg_id: 'PVLS0100'
 


More information about the syslog-ng mailing list