three letter day of week (case insensitive): MON, TUE, WED, THUR, THU, FRI, SAT, SUN
Alpha, fixed width field: AM or PM
Seconds, fixed width field: 00-59
Variable width field: Seconds: 00-60
Year, fixed width field: 0000-9999
Unix Time-Stamp (e.g.: 1424849941)
Mapped offsets or time zones are not applied and it is assumed that the generating clock is accurate.
Timezone Abbreviation: EST, UTC, GMT-5, etc...
UTC offset: Z, +/-HH:MM, or +/-HHMM
'Z' and 'z' added in 11.5 and 11.4.1
Fractional seconds: 0 - 999999999
Ignored in final value since the time is stored in seconds (added in 11.5 and 11.4.1)
The literal character '%'
Use "%%" for parsing character "%".
Populating Missing Year
If there is no year associated with a format string, the parser will attempt to populate the year heuristically.
In most cases, the value will be populated with the current year. There are however edge cases which are described below.
The current year is assigned as the message year (UTC, per the clock on the Log Decoder)....
Latent log during transition to new year
If the day resulting from assignment is more than 31 days into the future, the year is decremented.
The message date is 2017-Dec-31. The current date is 2018-Jan-1. The calculated date will be more than 31 days into the future 2018-Dec-31.
This will cause the year component to be decremented to 2017, resulting in an accurate message time.
Logs from forward time zones (or skewed clocks) just before new year transition
If the day resulting from assignment is more than 334 days into the past, the year is incremented.
The message date is 2018-Jan-1. The current date is 2017-Dec-31. The calculated date will be more than 334 days into the past 2017-Jan-1.
This will cause the year component to be incremented to 2018, resulting in an accurate message time.
Latent logs received where a leap-day cannot be successfully assigned to an appropriate leap-year
If the day (Feb-29) resulting from assignment is invalid (i.e. the assigned year is NOT a leap-year), the relative position to the current time cannot be calculated. To do this, the year is decremented in an attempt get a valid time-stamp.
Because the position of the leap-day relative to the transition to the new year, along with the expectation that no logs would be received this far into the future, we do not ever make an attempt to increment the year to produce a valid time-stamp.
After the year is decremented, the logic in bullets 1. and 2. is then followed. If the result is still an invalid day. The parser throws and a valid message time cannot be parsed.
There is currently no mechanism to assign a year to the import of logs.
As this pertains to leap-days, if we hunted for the correct leap-year, inconsistent data would result. For example, if a set of messages is two years old and during a leap-year, we'd have a single day which was accurate, only attainable because of the limiting characteristics of that day. Because of the heuristic described above, the remaining set of messages would have time-stamps one year too new.
For the sake of data consistency, we do not hunt for valid leap years beyond the +1 month and -11 month window currently used for assignment.