[syslog-ng] confgen not usable (by me) 3.13.2 on Redhat 7

Evan Rempel erempel at uvic.ca
Sun Feb 18 05:36:09 UTC 2018


I am using the copr RPM build syslog-ng-3.13.2-3.el7.centos.x86_64 on a 
redhat 7 system.

I am trying to use the confgen to create a value and use it in a rewrite.

I realize that I can use $LOGHOST in this context but am using it as an 
example.


@module confgen context(rewrite) name(z_myself) exec("/usr/bin/hostname")
rewrite r_local { set( "z_myself()", value("HOST") ); };
log {
         source(local);
         rewrite(r_local);
         destination(d_var_syslog);
};


d_var_syslog is any file destination to capture the log message.


The above configuration actually sets the hostname in the log line to be 
"z_myself()".

2018-02-17T21:15:39.220-08:00 z_myself() solaris-cron.err erempel: just 
testing

if I make the rewrite

rewrite r_local { set( z_myself(), value("HOST") ); };


I get syntax errors.

The top example works on redhat 6 with syslog-ng 3.9

I can't find any documentation on how to use a block (confgen) define in 
a rewrite statement.

I have tried back ticks, $(z_myself()) macros "`z_myself()`" and any 
other combination but they all result in syslog-ng failing to start.

What am I doing wrong?

Evan.



More information about the syslog-ng mailing list