<div dir="ltr"><div><div><div>Hi,<br><br></div>you can use backticks to refer to environment variables. I think these were introduced in 3.4.<br><br></div>tcp(port(`MY_PORT`))<br><br><br></div><div>It can also use values defined within the configuration files using the @define pragma:<br><br></div><div>@define MY_PORT 12345<br><br></div><div>Or something like that.<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">-- <br>Bazsi<br></div></div></div>
<br><div class="gmail_quote">On Mon, Jul 13, 2015 at 8:44 AM, Peter Flood <span dir="ltr"><<a href="mailto:info@whywouldwe.com" target="_blank">info@whywouldwe.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I'm trying configure syslog-ng, I'd like to be able to use environment<br>
variables for host & port. I've tried the ones that work in the template<br>
formatter but it's not working (not suprisingly). Is there another way?<br>
<br>
destination d_my_dest {<br>
tcp("$(env MY_HOST)" port($(env MY_PORT)) # this doesn't work as<br>
you can't get env vars unless in a template<br>
tls(peer-verify(required-untrusted) ca_dir("/etc/syslog-ng/cert.d"))<br>
template(myTemplate));<br>
};<br>
<br>
Thanks<br>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/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/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote></div><br></div>