<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"). </div><div><br></div><div>echo $HOSTAME provides the expected string.... I then would like to append this to a set of messages based upon a specific destination. I'm using syslog-ng 3.2.5. In this case the 'hostname' is just an example, I know that the sending hostname is automatically prepended - 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 { file("/var/log/web_call" template("<$PRI> $DATE $HOST $MSGHDR$MSG host=`HOSTNAME` \n") template_escape(no)); };</b></div><div><b>filter f_web_call { 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> source(s_sys);</b></div><div><b> filter(f_web_call);</b></div><div><b> destination (d_web_call);</b></div><div><b> 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><141> Sep 26 17:21:18 <a href="http://lab.xxxx.com">lab.xxxx.com</a> apache-call-tst: This is a test message25 host= </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....). If tried things with 'define' and using the '$' but not back-tick for the shell variable. 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>