# Failed to parse multiple date fields

**URL:** <https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383>\
**Category:** Logstash\
**Created:** [October 19, 2016, 11:15am UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383 "2016-10-19T11:15:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![setlem](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@setlem](https://discuss.elastic.co/u/setlem)\
**Post date:** [October 19, 2016, 11:15am UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/1 "2016-10-19T11:15:21Z")

</div>

Hi,

my config file is

> [@](#):
>
> date {  
> locale =\> "en"  
> match =\> ["CREATION\_DATE", "dd-MMM-yy hh.mm.ss.SSSSSSSSS a"]  
> target =\> "CREATION\_DATE"  
> }
> 
> date {  
> locale =\> "en"  
> match =\> ["SUBMITTED\_DATE", "dd-MMM-yy hh.mm.ss.SSSSSSSSS a"]  
> target =\> "SUBMITTED\_DATE"  
> }
> 
> date {  
> match =\> ["LAST\_MODIFIED\_DATE", "dd-MMM-yy hh.mm.ss.SSSSSSSSS a"]  
> target =\> "@timestamp"  
> }

date is parsing only for LAST\_MODIFIED\_DATE. But not for CREATION\_DATE and SUBMITTED\_DATE  
Suggest me the way to fix this.  
Thanks!!!!!

---

<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:** [October 19, 2016, 12:16pm UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/2 "2016-10-19T12:16:18Z")

</div>

What does an example event look like? No screenshot please, use copy/paste from Kibana or a `stdout { codec => rubydebug }` output.

---

<div class="post-metadata">

**Author:** ![setlem](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@setlem](https://discuss.elastic.co/u/setlem)\
**Post date:** [October 19, 2016, 12:23pm UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/3 "2016-10-19T12:23:36Z")

</div>

input is

> [@](#):
>
> "o50002",0,24,"default","150001","o50002","PROCESSING" ,"The state of order [o50002] has been changed to processing","",0,11-JUL-13 06.40.36.794000000 PM,11-JUL-13 06.41.46.313000000 PM,11-JUL-13 06.42.20.023000000 PM,"","ai10001","ai10005",0,"",0,"storeSiteUS","storeSiteUS",0

in output am getting  
"tags" =\> [  
[0] "\_dateparsefailure"

---

<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:** [October 19, 2016, 1:13pm UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/4 "2016-10-19T13:13:11Z")

</div>

There are a couple of things that the date filter will be unhappy about:

- The month name is uppercase.
- I don't think it support nanoseconds.

Your Logstash log should contain clues about what it complains about.

---

<div class="post-metadata">

**Author:** ![setlem](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@setlem](https://discuss.elastic.co/u/setlem)\
**Post date:** [October 20, 2016, 5:50am UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/5 "2016-10-20T05:50:40Z")

</div>

Hi  
Thanks for ur reply magnus.

I have tried a sample code by giving single date,It worked.  
Yes,Timestamp wont take nano [seconds.It](http://seconds.It) takes milli second only.  
am getting \_dateparsefailure error only when i give multiple date filters.  
input is  
[quote]  
"o920002",0,15,"default","1100000","o920002","INCOMPLETE","","",0,13-DEC-13 03.14.15.968 PM,""`,15-DEC-13 05.36.52.550 PM`,"","","",0,"",0,"saraDefaultSite","saraDefaultSite",0  
[/quote]  
config is  
[quote]

date {  
locale =\> "en"  
match =\> ["CREATION\_DATE", "dd-MMM-yy hh.mm.ss.SSSa"]  
target =\> "CREATION\_DATE"  
}

date {  
locale =\> "en"  
match =\> ["SUBMITTED\_DATE", "dd-MMM-yy hh.mm.ss.SSS a"]  
target =\> "SUBMITTED\_DATE"  
}

date {  
match =\> ["LAST\_MODIFIED\_DATE", "dd-MMM-yy hh.mm.ss.SSS a"]  
target =\> "`@timestamp`"  
}  
[/quote]  
The output file is  
[quote]  
"ORDER\_ID" =\> "o920002",  
"TYPE" =\> "0",  
"VERSION" =\> "15",  
"ORDER\_CLASS\_TYPE" =\> "default",  
"PROFILE\_ID" =\> "1100000",  
"DESCRIPTION" =\> "o920002",  
"STATE" =\> "INCOMPLETE",  
"STATE\_DETAIL" =\> "",  
"CREATED\_BY\_ORDER" =\> "",  
"ORIGIN\_OF\_ORDER" =\> "0",  
"CREATION\_DATE" =\> "2013-12-13T09:44:15.968Z",  
"SUBMITTED\_DATE" =\> "",  
"LAST\_MODIFIED\_DATE" =\> "`15-DEC-13 05.36.52.550 PM`",  
"COMPLETED\_DATE" =\> "",  
"PRICE\_INFO" =\> "",  
"TAX\_PRICE\_INFO" =\> "",  
"EXPLICITLY\_SAVED" =\> "0",  
"AGENT\_ID" =\> "",  
"SALES\_CHANNEL" =\> "0",  
"CREATION\_SITE\_ID" =\> "saraDefaultSite",  
"SITE\_ID" =\> "saraDefaultSite",  
"GWP" =\> "0",  
"mytime" =\> "",  
"tags" =\> [  
[0] "\_dateparsefailure"  
]  
}  
[/quote]  
my date is parsing only for `target => "@timestamp"`  
but not for `target => "CREATION_DATE"` and target =\> "SUBMITTED\_DATE"  
and I don't think there is a problem with uppercase of month.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 20, 2016, 5:59am UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/6 "2016-10-20T05:59:02Z")

</div>

In this example SUBMITTED\_DATE is an empty string, would it not be that which is causing the `_dateparsefailure`? Does the `@timestamp` field get set properly in your example? You may want to wrap the date processing in conditionals to verify that the field contains data before running the date filter.

---

<div class="post-metadata">

**Author:** ![setlem](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@setlem](https://discuss.elastic.co/u/setlem)\
**Post date:** [October 20, 2016, 6:21am UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/7 "2016-10-20T06:21:59Z")

</div>

Thank a lot Christian,  
It worked .that empty string was causing \_dateparsefailure.I will use conditionals and fix it.🙂

---

<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:** [July 6, 2017, 4:33am UTC](https://discuss.elastic.co/t/failed-to-parse-multiple-date-fields/63383/8 "2017-07-06T04:33:28Z")

</div>


