<div dir="auto">You should generate the entire set() from within the confgen. That should work. Iirc there was a fix that causes the old one not to work (whereas due to a bug it did work earlier).<div dir="auto"><br></div><div dir="auto">If you only want to substitute the argument, you can use a defines, or even an scl that wraps the entire set into a block.</div><div dir="auto"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Feb 18, 2018 06:36, "Evan Rempel" <<a href="mailto:erempel@uvic.ca">erempel@uvic.ca</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am using the copr RPM build syslog-ng-3.13.2-3.el7.centos.<wbr>x86_64 on a redhat 7 system.<br>
<br>
I am trying to use the confgen to create a value and use it in a rewrite.<br>
<br>
I realize that I can use $LOGHOST in this context but am using it as an example.<br>
<br>
<br>
@module confgen context(rewrite) name(z_myself) exec("/usr/bin/hostname")<br>
rewrite r_local { set( "z_myself()", value("HOST") ); };<br>
log {<br>
source(local);<br>
rewrite(r_local);<br>
destination(d_var_syslog);<br>
};<br>
<br>
<br>
d_var_syslog is any file destination to capture the log message.<br>
<br>
<br>
The above configuration actually sets the hostname in the log line to be "z_myself()".<br>
<br>
2018-02-17T21:15:39.220-08:00 z_myself() solaris-cron.err erempel: just testing<br>
<br>
if I make the rewrite<br>
<br>
rewrite r_local { set( z_myself(), value("HOST") ); };<br>
<br>
<br>
I get syntax errors.<br>
<br>
The top example works on redhat 6 with syslog-ng 3.9<br>
<br>
I can't find any documentation on how to use a block (confgen) define in a rewrite statement.<br>
<br>
I have tried back ticks, $(z_myself()) macros "`z_myself()`" and any other combination but they all result in syslog-ng failing to start.<br>
<br>
What am I doing wrong?<br>
<br>
Evan.<br>
<br>
______________________________<wbr>______________________________<wbr>__________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailm<wbr>an/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support<wbr>/documentation/?product=<wbr>syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/sy<wbr>slog-ng-faq</a><br>
<br>
</blockquote></div></div>