You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A syslog file with a log message format without a date does not revise the guesstimated year when it encounters a log message with datestamp on leap year day February 29.
To Reproduce
Use committed log file ./logs/other/tests/dtf9c-23-12x2.log.gz with a Last Modified Time of September 2018. The GZIP encoded datetime is September 2, 2022 9:45:35 PM GMT-07:00 (derived from modified time 1662180335).
The GZIP encoded datetime is used to place the last log message Dec 12 12:00:00 23; datetimestamp Dec 12 12:00:00 is guesstimated to be year 2022.
During processing, log message Feb 29 02:00:00 1 is encountered. It is given incorrect year 2021.
$ ls -l ./logs/other/tests/dtf9c-23-12x2.log.gz
-rw-r--r-- 1 user user 207 Sep 2 2018 ./logs/other/tests/dtf9c-23-12x2.log.gz
$ gunzip --stdout -k ./logs/other/tests/dtf9c-23-12x2.log.gz
Jan 1 01:00:00 0
Feb 29 02:00:00 1
Mar 3 03:00:00 2
Apr 4 04:00:00 3
May 5 05:00:00 4
Jun 6 06:00:00 5
Jul 7 07:00:00 6
Aug 8 08:00:00 7
Sep 9 09:00:00 8
Oct 10 10:00:00 9
Nov 11 11:00:00 10
Dec 12 12:00:00 11
Jan 1 01:00:00 12
Feb 28 02:00:00 13
Mar 3 03:00:00 14
Apr 4 04:00:00 15
May 5 05:00:00 16
Jun 6 06:00:00 17
Jul 7 07:00:00 18
Aug 8 08:00:00 19
Sep 9 09:00:00 20
Oct 10 10:00:00 21
Nov 11 11:00:00 22
Dec 12 12:00:00 23
Since the GZIP Modified Time is Sept. 2022, then the last message Dec 12 12:00:00 23 should be given year 2022 (which it currently is). However, upon encountering Feb 29 02:00:00 1 and it is given date 20210101T080000.000+0000 (Jan 1 2021).
Instead, the processing should notice that attempts to create a datetime for that log message failed. It should attempt a leap day valid year, e.g. 2000, and if that succeeds then it can confirm the date is Feb. 29. When datestamp Feb. 29 is confirmed, the processing should revise it's year guesstimate, and then update previously processed log messages.
In this case, during the backwards search for log messages in process_missing_year, it should allow for matching date Feb 29 no matter the guesstimated year.
The revised year guesstimate should result in last message Dec 12 12:00:00 23 given year 2017, and message Feb 29 02:00:00 1 given valid datetime year 2016, i.e. 20160229T080000.000+0000.
Summary
A syslog file with a log message format without a date does not revise the guesstimated year when it encounters a log message with datestamp on leap year day February 29.
To Reproduce
Use committed log file
./logs/other/tests/dtf9c-23-12x2.log.gz
with a Last Modified Time of September 2018. The GZIP encoded datetime is September 2, 2022 9:45:35 PM GMT-07:00 (derived from modified time 1662180335).The GZIP encoded datetime is used to place the last log message
Dec 12 12:00:00 23
; datetimestamp Dec 12 12:00:00 is guesstimated to be year 2022.During processing, log message
Feb 29 02:00:00 1
is encountered. It is given incorrect year 2021.The result
Expected
Since the GZIP Modified Time is Sept. 2022, then the last message
Dec 12 12:00:00 23
should be given year 2022 (which it currently is). However, upon encounteringFeb 29 02:00:00 1
and it is given date20210101T080000.000+0000
(Jan 1 2021).Instead, the processing should notice that attempts to create a datetime for that log message failed. It should attempt a leap day valid year, e.g. 2000, and if that succeeds then it can confirm the date is Feb. 29. When datestamp Feb. 29 is confirmed, the processing should revise it's year guesstimate, and then update previously processed log messages.
In this case, during the backwards search for log messages in
process_missing_year
, it should allow for matching date Feb 29 no matter the guesstimated year.The revised year guesstimate should result in last message
Dec 12 12:00:00 23
given year 2017, and messageFeb 29 02:00:00 1
given valid datetime year 2016, i.e.20160229T080000.000+0000
.Additional context
Found while investigating #189.
The text was updated successfully, but these errors were encountered: