# Logstash date parsing error ( date field doesn't have any time)

**URL:** <https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737>\
**Category:** Logstash\
**Created:** [December 21, 2017, 2:58am UTC](https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737 "2017-12-21T02:58:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arjun\_subramanyam\_va](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Arjun\_subramanyam\_va](https://discuss.elastic.co/u/Arjun_subramanyam_va)\
**Post date:** [December 21, 2017, 2:58am UTC](https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737/1 "2017-12-21T02:58:38Z")

</div>

down vote  
favorite  
My data has date in the format yyyy-MM-dd ex : "2015-10-12"

My logstash date filter is as below

date {  
match =\> ["start\_date", "yyyy-MM-dd"]  
target =\> "start\_date"  
}  
However, my es instance is not able to parse it and I'm getting following error

"error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse [study.startDate]", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Invalid format: "2012-04-17T00:00:00.000Z" is malformed at "T00:00:00.000Z""}}}}

---

<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:** [December 21, 2017, 7:18am UTC](https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737/2 "2017-12-21T07:18:51Z")

</div>

What's the mapping of the field in ES?

---

<div class="post-metadata">

**Author:** ![Arjun\_subramanyam\_va](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Arjun\_subramanyam\_va](https://discuss.elastic.co/u/Arjun_subramanyam_va)\
**Post date:** [December 21, 2017, 7:13pm UTC](https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737/3 "2017-12-21T19:13:26Z")

</div>

"startDate": {  
"type": "date",  
"format": "yyyy-MM-dd"  
},

---

<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:** [December 22, 2017, 6:25am UTC](https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737/4 "2017-12-22T06:25:12Z")

</div>

I guess you can't stuff "2012-04-17T00:00:00.000Z" into a field that accepts a yyyy-MM-dd date format. I suppose ES in this case autodetected the previous field value (containing just the date) as a yyyy-MM-dd date. Mappings can't be changed without reindexing so if possible the easiest way out would be to just delete the index and start over.

---

<div class="post-metadata">

**Author:** ![Arjun\_subramanyam\_va](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Arjun\_subramanyam\_va](https://discuss.elastic.co/u/Arjun_subramanyam_va)\
**Post date:** [December 23, 2017, 1:21am UTC](https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737/5 "2017-12-23T01:21:18Z")

</div>

@magnusbaeck deleting the old template file and re-processing worked, Thank you

---

<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:** [January 20, 2018, 1:21am UTC](https://discuss.elastic.co/t/logstash-date-parsing-error-date-field-doesnt-have-any-time/112737/6 "2018-01-20T01:21:31Z")

</div>

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