[syslog-ng]$DAY not working in filenames macros in 1.6.x as it did in 1.5.x
Andrew Fort
syslog-ng@lists.balabit.hu
Thu, 03 Feb 2005 12:23:12 +1100
Hi guys, I am running syslog-ng 1.5.15 on some debian stable machines.
All good, all happy.
I have a source:
source network-hosts {
udp(ip(0.0.0.0) port(8514));
tcp(ip(0.0.0.0) port(8514) max-connections(200));
};
I use filename macro expansion to auto-rotate my logs. My destinations
look exactly like:
destination logfiles-host {
file("/var/log/HOSTS/$HOST/$YEAR/$MONTH/$YEAR$MONTH$DAY\_$HOST\_$PROGRAM"
template("$ISODATE [$HOST] <$FACILITY> $MSG\n")
template_escape(no)
owner(root)
group(logs)
perm(0660)
dir_perm(0770)
create_dirs(yes));
};
the routing stanza goes:
log {
source(network-hosts);
destination(logfiles-host);
};
This works as I expect (even without escaping the _'s between $DAY,
$HOST and $PROGRAM).
My log paths look like:
/var/log/HOSTS/mel1/2005/02/20050203_mel1_named
/var/log/HOSTS/mel1/2005/02/20050203_mel1_sendmail
Great.
However, using 1.6.x (I've not tested 1.6.6, to be sure, only 1.6.4 and
1.6.5) on both Solaris and Linux, using the exact same config (i.e.,
when I upgraded, for example), using this destination:
destination d_local {
file("/var/log/LOCAL/$HOST/$YEAR/$MONTH/$YEAR$MONTH$DAY\_$HOST"
template("$ISODATE [$HOST] <$FACILITY> $MSG\n")
template_escape(no)
perm(0660)
dir_perm(0770)
create_dirs(yes));
};
I get this:
/var/log/LOCAL/mel1/2005/02/200502mel1
So $DAY is not expanding. Same thing occurs when I use
file("/var/log/LOCAL/$HOST/$YEAR/$MONTH/$YEAR$MONTH$DAY_$HOST"
Is this a problem with $DAY, the _, or something else?
Let me know if I can provide further info to help debug this..
Anyone else run into this? I'd like to upgrade all my boxes to
1.6.{4,5,6} eventually but at the moment this is holding me back from
moving to 1.6.
Cheers,
Andrew Fort