<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Greetings,<div><br></div><div>I'm trying to get an environment variable (As defined in the shell - take for example "HOSTNAME"). &nbsp;</div><div><br></div><div>echo $HOSTAME provides the expected string.... &nbsp;I then would like to append this to a set of messages based upon a specific destination. &nbsp;I'm using syslog-ng 3.2.5. In this case the 'hostname' is just an example, &nbsp;I know that the sending hostname is automatically prepended &nbsp;- used here because it's commonly defined on systems.</div><div><br></div><div>I've included the following config lines from my syslog-ng.conf file.</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>destination d_web_call&nbsp; &nbsp; &nbsp;&nbsp;{ file("/var/log/web_call" template("&lt;$PRI&gt; $DATE $HOST $MSGHDR$MSG host=`HOSTNAME`&nbsp;\n") template_escape(no)); };</b></div><div><b>filter f_web_call&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;{ facility(local1) and ( match("^.*apache-call.*$" value("MSGHDR")) );};</b></div></blockquote><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>log {</b></div><div><b>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;source(s_sys);</b></div><div><b>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;filter(f_web_call);</b></div><div><b>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;destination (d_web_call);</b></div><div><b>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;flags(final,flow-control);</b></div><div><b>};</b></div></blockquote><div><br><br></div><div>Using the following test string:</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>/usr/bin/logger -t apache-call-tst -p local1.notice "This is a test message 25"</b></div></blockquote><div><br></div><div>I get the following:</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>&lt;141&gt; Sep 26 17:21:18 <a href="http://lab.xxxx.com">lab.xxxx.com</a> apache-call-tst: This is a test message25 host=&nbsp;</b></div></blockquote><div><br></div><div><br></div><div><br></div><div>I've received a few pointers from folks here (including going to 3.5 which can't be completed in the short term....). &nbsp;If tried things with 'define' and using the '$' but not back-tick for the shell variable. &nbsp;It is not clear when this value is set (if at all) within the config file.</div><div><br></div><div>Thanks,</div><div>Jim.</div><div><br></div><div><br></div></body></html>