[syslog-ng] [Bug 153] default year when no year is present should be current year

bugzilla at bugzilla.balabit.com bugzilla at bugzilla.balabit.com
Wed Dec 21 13:46:28 CET 2011


https://bugzilla.balabit.com/show_bug.cgi?id=153


Balazs Scheidler <bazsi at balabit.hu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|                            |INVALID
             Status|NEW                         |RESOLVED




--- Comment #1 from Balazs Scheidler <bazsi at balabit.hu>  2011-12-21 13:46:27 ---
If there's no year in the incoming timestamp, syslog-ng applies a
heuristics to determine the actual year. This heuristics assumes that
the incoming message was generated quite close to the current system
time.

Here's the algorithm (quoting the source):

          /* detect if the message is coming from last year. If its
           * month is at least one larger than the current month. This
           * handles both clocks that are in the future, or in the
           * past:
           *   in January we receive a message from December (past) => last year
           *   in January we receive a message from February (future) => same year
           *   in December we receive a message from January (future) => next year
           */
          if (tm.tm_mon > nowtm.tm_mon + 1)
            tm.tm_year--;
          if (tm.tm_mon < nowtm.tm_mon - 1)
            tm.tm_year++;


-- 
Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the syslog-ng mailing list