[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:30:21 +1100


Andrew Fort wrote:

Oops - I knew I should've tried this before the original post.

> 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?

I changed the file line to:
     file("/var/log/LOCAL/$HOST/$YEAR/$MONTH/$YEAR$MONTH$DAY-$HOST-$PROGRAM"

And now I get what I am looking for,

e.g.

/var/log/LOCAL/mel1/2005/02/20050203-mel1-syslog-ng

So, what's special about the underscore? (i'd prefer to use an 
underscore if I could... :).

Cheers,
andrew