Hi, I have a Solaris 8 host with syslog-ng ver 1.6.5 set up with the following syslog-ng.conf: options { use_time_recvd(no); # Use the time a message is received instead of the one specified in the message. sync(0); # The number of lines buffered before written to file. }; source src { udp(ip("0.0.0.0") port(514)); tcp(ip("0.0.0.0") port(514) max-connections(100)); sun-streams("/dev/log" door("/etc/.syslog_door")); # local solaris syslog internal(); # syslog-ng interne meldinger }; source s_syslog_ng { internal(); # syslog-ng interne meldinger }; destination dst_template { file("/syslog/$R_YEAR/$R_MONTH/$R_DAY/$HOST" template("$R_YEAR-$R_MONTH-$R_DAY $R_HOUR:$R_MIN:$R_SEC | $R_UNIXTIME | $S_YEAR-$S_MONTH-$S_DAY $S_HOUR:$S_MIN:$S_SEC | $S_UNIXTIME | $HOST | $HOST_FROM | $FULLHOST | $SOURCEIP | $FACILITY.$PRIORITY | $TAG | $PROGRAM | $MSG\n") ); }; destination d_syslog_ng { file("/syslog/syslog-ng.log" sync(0) log_fifo_size(10) perm(0644) ); }; log { source (s_syslog_ng); destination (d_syslog_ng); }; log { source(src); destination(dst_template); }; Then I have another host set up to use syslog-ng as loghost. This host has purposely wrong time (1973-01-02), as can be seen here: joe@testhost / $ logger "test. local time on `uname -n` is `date +'%Y-%m-%d %H:%m:%S'`" joe@loghost / $ tail -1 /syslog/2005/02/01/testhost 2005-02-01 11:24:47 | 1107253487 | 2005-01-02 21:04:39 | 1104696279 | testhost | testhost | testhost/testhost | 192.168.1.2 | user.notice | 0d | joe | joe: [ID 702911 user.notice] test. local time on testhost is 1973-01-02 21:01:39 It seems as S_YEAR is set to YEAR (or R_YEAR, I have not checked the source). I hope someone can fix this before syslog-ng 1.6.6... Regards Jan Thomas Moldung
On Tue, 2005-02-01 at 11:39 +0100, janth@moldung.no wrote:
Hi, I have a Solaris 8 host with syslog-ng ver 1.6.5 set up with the following syslog-ng.conf:
Then I have another host set up to use syslog-ng as loghost. This host has purposely wrong time (1973-01-02), as can be seen here:
joe@testhost / $ logger "test. local time on `uname -n` is `date +'%Y-%m-%d %H:%m:%S'`"
joe@loghost / $ tail -1 /syslog/2005/02/01/testhost 2005-02-01 11:24:47 | 1107253487 | 2005-01-02 21:04:39 | 1104696279 | testhost | testhost | testhost/testhost | 192.168.1.2 | user.notice | 0d | joe | joe: [ID 702911 user.notice] test. local time on testhost is 1973-01-02 21:01:39
It seems as S_YEAR is set to YEAR (or R_YEAR, I have not checked the source). I hope someone can fix this before syslog-ng 1.6.6...
The problem is that there is no 'year' field in the syslog message, except if you are using a message format which does include a year. (The PIX style timestamp includes a year and syslog-ng supports its extraction: /* PIX time stamp, format: MMM DD YYYY HH:MM:SS: */ However this is much better solved in syslog-ng 1.9.x which also fully supports ISO timestamps (year, timezone and fractions of seconds) -- Bazsi
participants (2)
-
Balazs Scheidler
-
janth@moldung.no