# Date parsing not working

**URL:** <https://discuss.elastic.co/t/date-parsing-not-working/118468>\
**Category:** Logstash\
**Created:** [February 5, 2018, 1:57pm UTC](https://discuss.elastic.co/t/date-parsing-not-working/118468 "2018-02-05T13:57:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cilzzz](https://avatars.discourse-cdn.com/v4/letter/c/c67d28/32.png) [@cilzzz](https://discuss.elastic.co/u/cilzzz)\
**Post date:** [February 5, 2018, 1:57pm UTC](https://discuss.elastic.co/t/date-parsing-not-working/118468/1 "2018-02-05T13:57:31Z")

</div>

Hi i have a date field that i need to parse having this format:

> Wed Nov 1 02:04:55 2017

my date filter would be :

```
date { 
              match => ["hpna_time", "MMM d HH:mm:ss YYYY"]
                  timezone => "Europe/Paris"
}

```

the parsing didn't work is there a way to eliminate the Wed ?

thank you!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 5, 2018, 2:22pm UTC](https://discuss.elastic.co/t/date-parsing-not-working/118468/2 "2018-02-05T14:22:59Z")

</div>

`EEE MMM d HH:mm:ss YYYY` should work.

---

<div class="post-metadata">

**Author:** ![cilzzz](https://avatars.discourse-cdn.com/v4/letter/c/c67d28/32.png) [@cilzzz](https://discuss.elastic.co/u/cilzzz)\
**Post date:** [February 5, 2018, 3:32pm UTC](https://discuss.elastic.co/t/date-parsing-not-working/118468/3 "2018-02-05T15:32:53Z")

</div>

thank you i have two days Oct 31 and Nov 1, the parsing is only applied on Nov 1

these are date formats from my log file

> Wed Nov 1 07:01:39 2017 ==\> (there is two spaces between Nov and 1)  
> Tue Oct 31 14:03:29 2017

so i 've tried

`match => ["hpna_time" , "EEE MMM d HH:mm:ss YYYY" , "EEE MMM dd HH:mm:ss YYYY"]`

no the parsing is applied on Oct 31 and not Nov 1

what should i do please?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 5, 2018, 3:43pm UTC](https://discuss.elastic.co/t/date-parsing-not-working/118468/4 "2018-02-05T15:43:16Z")

</div>

Do you have two spaces before "d" in your first pattern?

When the filter fails it logs a message that points to the part of the string where the error is.

---

<div class="post-metadata">

**Author:** ![cilzzz](https://avatars.discourse-cdn.com/v4/letter/c/c67d28/32.png) [@cilzzz](https://discuss.elastic.co/u/cilzzz)\
**Post date:** [February 5, 2018, 3:46pm UTC](https://discuss.elastic.co/t/date-parsing-not-working/118468/5 "2018-02-05T15:46:49Z")

</div>

yes i had two spaces before my first d patterns like in the log file then i've changed it  
and it works now thanks !

---

<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 5, 2018, 3:46pm UTC](https://discuss.elastic.co/t/date-parsing-not-working/118468/6 "2018-03-05T15:46:57Z")

</div>

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