So is something like this possible? I am writing a template with a few
parts - a base directory name, the hostname of the originating server,
and then the log file name.  After defining the template, some
conditions for the different files.  I just want a different file based
on different conditions, without redefining the template.  So, something
like:

template(name="tpltest" type="list") {
    constant(value="/var/log/")
    property(name="hostname")
    constant(value="/")
    property(name="$.filename")
}

    if $programname == "micah" and $syslogfacility-text == 'local1' then {
        set $.filename = "loggerstuff"
        action(type="omfile" Template="tpltest" DirOwner="root"
DirGroup="root" FileOwner="root" FileGroup="root" DirCreateMode="0755"
FileCreateMode="0644")
    }

    if $programname == "puppet-agent" and $syslogfacility-text ==
'local1' then {
        set $.filename = "puppet"
        action(type="omfile" Template="tpltest" DirOwner="root"
DirGroup="root" FileOwner="root" FileGroup="root" DirCreateMode="0755"
FileCreateMode="0644")
    }


It doesn't seem to be parsing in 7.4.4 which I have installed, but I
might be doing something wrong.  If it isn't possible in this version,
is it in 7.5.x or 8.1.x?

Thanks much!
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to