Leap year problem on Logstash date filter

Logs in the following formats are now failing:

"timestamp_str": "Feb 29 00:00:00"

filter config:

filter {
    date {
      match => ["timestamp_str", "MMM dd HH:mm:ss", "MMM  d HH:mm:ss"]
      timezone => "Asia/Tokyo"
      target => "timestamp"
    }
}

I guess it is due to the leap year because there was no problem until yesterday.

My Logstash process is running for at least 6 months.

The time format we have has no year listed, so we'll have to guess the year.

"Feb 29 " should be parsed as "2020-02-29".
But "Feb 29 2019" is not correct.

parser = DateTimeFormat.forPattern(pattern).withDefaultYear(clock.read().getYear()).withLocale(locale).withZone(DateTimeZone.forID(timezone));

If this initialization process is executed only once at the starting time, "Feb 29 " might be parsed as "Feb 29 of 2019".

What should I do for this? Restarting Logstash may help?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.