# Leap year problem on Logstash date filter

**URL:** https://discuss.elastic.co/t/leap-year-problem-on-logstash-date-filter/221512
**Category:** Logstash
**Created:** [February 29, 2020, 8:27am UTC](https://discuss.elastic.co/t/leap-year-problem-on-logstash-date-filter/221512 "2020-02-29T08:27:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![taro\_x](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/taro_x/32/63562_2.png) [@taro\_x](https://discuss.elastic.co/u/taro_x)
#### Post date: [February 29, 2020, 8:27am UTC](https://discuss.elastic.co/t/leap-year-problem-on-logstash-date-filter/221512/1 "2020-02-29T08:27:54Z")

</div>

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.

> <https://github.com/logstash-plugins/logstash-filter-date/blob/v3.1.9/src/main/java/org/logstash/filters/parser/JodaParser.java>

> 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?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 28, 2020, 8:27am UTC](https://discuss.elastic.co/t/leap-year-problem-on-logstash-date-filter/221512/2 "2020-03-28T08:27:59Z")

</div>

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