Hello;
I’m somewhat of a newbie when it comes to syslog-ng so forgive me if the question is somewhat basic. I am running syslog-ng 3.25 on both server and clients and would like to set a variable based on the source. This is what I have:
@define server-logdir "/var/log"
@define client-logdir "/var/log/CLIENTS/$YEAR/$MONTH_ABBREV/$DAY/$HOST"
@define logdir ""
source s_local {
logdir `server-logdir`; *No!
...
...
};
source s_network {
logdir `client-logdir`; *No!
...
...
};
destination d_local0 {
file( "`logdir`/local/local0.log" );
};
The goal is to set ‘logdir’ to either ‘server-logdir’ or ‘client-logdir’ and use it in the destination. I know there are probably several ways that this can be accomplished but I think this was will cut down on the number of lines in the configuration. So my question
Is this. How do I set ‘logdir’ to either ‘server-logdir’ or ‘client-logdir’ in the source definition?
Thanks;
DiGennaro
Frank DiGennaro
301-676-8193 (C)