On Wed, 2005-08-03 at 16:01 -0700, Arnold Wang wrote:
Hi, I'm running into a strange problem with syslog-ng 1.6.8 on RHEL 4. In my configuration file, I have the following local log file defined: destination d_file { file("/var/syslog- ng/HOSTS/$HOST/$YEAR/$MONTH/$HOST_$MONTH$DAY.log" owner(root) group (root) perm(0600) dir_perm(0700) create_dirs(yes)); }; However, the log file generated by the syslog-ng for today is named "0803.log", which is different than "hostname_0803.log" as I expected. I tried using escape "\" so it looks like "$HOST\_$MONTH$DAY.log" and it didn't help at all. This problem actually doesn't bother me that much. I changed "_" to "-" or ".", it worked. I'm just curious about this.
The performance of macro expansion was improved sometime during the end of the 1.5.x series, which makes syslog-ng extract the macro name first, and then looking up the macro name using a gperf generated hash. The character set of words in syslog-ng is [A-Z0-9_], therefore it uses _ as part of a word. Syslog-ng 1.9.x improves on the situation by permitting the use of shell like ${macro} expansion, where you could write: ${macro}_${othermacro} and so on. -- Bazsi