[syslog-ng] runtime definition of a constant

Jakub Jankowski shasta at toxcorp.com
Thu Apr 24 02:00:36 CEST 2014


On 24.04.2014 00:57, Evan Rempel wrote:
>
> I have a use case where I want to preface every message from a source with some kind of instance name.
> It would be easy to create a static template, but I would like to be able to use the same configuration include
> on all of the hosts and provide the "instance" name from a local configuration space.
>
> Is there any way to do this kind of thing
>
> @module confgen context(root) name(myinstance) exec("/bin/cat /path/to/instance/file")
> @define instance "myinstance()"
> template t_mytemplate     { template("<$pri>$parsedate $parsehost ldap: `instance`: $parsemessage\n"); template_escape(no); };
>
> or if the confgen could have a template context
>
> @module confgen context(template) name(myinstance) exec("/bin/cat /path/to/instance/file")
> template t_mytemplate     { template("<$pri>$parsedate $parsehost ldap: $(myinstance): $parsemessage\n"); template_escape(no); };

Hm, why don't you just include a syslog-ng configuration snippet (that 
sets what you want) from a file that is local to your instance?


Jakub

-- 
Jakub Jankowski|shasta at toxcorp.com|http://toxcorp.com/
GPG: FCBF F03D 9ADB B768 8B92 BB52 0341 9037 A875 942D


More information about the syslog-ng mailing list