[syslog-ng] Host/port from environment variables

Peter Flood info at whywouldwe.com
Wed Jul 15 08:10:14 CEST 2015


Backticks work, thanks.

On 13/07/2015 12:53, Scheidler, Balázs wrote:
> Hi,
>
> you can use backticks to refer to environment variables. I think these 
> were introduced in 3.4.
>
> tcp(port(`MY_PORT`))
>
>
> It can also use values defined within the configuration files using 
> the @define pragma:
>
> @define MY_PORT 12345
>
> Or something like that.
>
> -- 
> Bazsi
>
> On Mon, Jul 13, 2015 at 8:44 AM, Peter Flood <info at whywouldwe.com 
> <mailto:info at whywouldwe.com>> wrote:
>
>     Hi
>
>     I'm trying configure syslog-ng, I'd like to be able to use environment
>     variables for host & port. I've tried the ones that work in the
>     template
>     formatter but it's not working (not suprisingly). Is there another
>     way?
>
>     destination d_my_dest {
>          tcp("$(env MY_HOST)" port($(env MY_PORT))  # this doesn't work as
>     you can't get env vars unless in a template
>          tls(peer-verify(required-untrusted)
>     ca_dir("/etc/syslog-ng/cert.d"))
>          template(myTemplate));
>     };
>
>     Thanks
>     ______________________________________________________________________________
>     Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
>     Documentation:
>     http://www.balabit.com/support/documentation/?product=syslog-ng
>     FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>
>
>
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20150715/c01777d4/attachment.htm 


More information about the syslog-ng mailing list