# Failed to parse date field error

**URL:** <https://discuss.elastic.co/t/failed-to-parse-date-field-error/194445>\
**Category:** Logstash\
**Created:** [August 8, 2019, 2:00pm UTC](https://discuss.elastic.co/t/failed-to-parse-date-field-error/194445 "2019-08-08T14:00:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssi](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@ssi](https://discuss.elastic.co/u/ssi)\
**Post date:** [August 8, 2019, 2:00pm UTC](https://discuss.elastic.co/t/failed-to-parse-date-field-error/194445/1 "2019-08-08T14:00:18Z")

</div>

hi i get these errors with one of the indexes (microsoft defender ATP data)

[2019-08-08T15:57:01,663][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"logstash-mdatp-2019.08.08", :\_type=\>"\_doc", :routing=\>nil}, #LogStash::Event:0x72f927bb], :response=\>{"index"=\>{"\_index"=\>"logstash-mdatp-2019.08.08", "\_type"=\>"\_doc", "\_id"=\>"Zs-EcWwBes\_2bu02wssO", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse field [records.properties.InitiatingProcessParentCreationTime] of type [date] in document with id 'Zs-EcWwBes\_2bu02wssO'", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"failed to parse date field [08/07/2019 12:32:32] with format [strict\_date\_optional\_time||epoch\_millis]", "caused\_by"=\>{"type"=\>"date\_time\_parse\_exception", "reason"=\>"Failed to parse with all enclosed parsers"}}}}}}

i looked round the forum and though i had found a solution here

> [@The curse of dynamic dates](https://discuss.elastic.co/t/the-curse-of-dynamic-dates/177633/4):
>
> No, I was not suggesting to change the "Z" in your input data. I was suggesting to replace the "Z" with an "X" in the date formats in your index template. The following works for me: PUT \_template/tpl { "template": "myindex.\*", "mappings": { "dynamic\_date\_formats": ["basic\_ordinal\_date\_time", "yyyy-MM-dd'T'HH:mm:ss.SX", "yyyy-MM-dd'T'HH:mm:ss.SSX", "yyyy-MM-dd'T'HH:mm:ss.SSSX"] } } PUT myindex.1/\_doc/1 { "my\_date": "2018-12-23T04:48:08.123Z" } GET my…

PUT \_template/tpl  
{  
"index\_patterns": "myidx.\*",  
"mappings": {  
"dynamic\_date\_formats": [  
"yyyy-MM-dd'T'HH:mm:ssX||yyyy-MM-dd'T'HH:mm:ss.SX||yyyy-MM-dd'T'HH:mm:ss.SSX||yyyy-MM-dd'T'HH:mm:ss.SSSX"  
]  
}  
}  
but i still get the error do i have do fix something in the logstash config with grok / mutate or what?

the data is comming in fine i just get a ton of warning msg, so i want to get rid of those.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 8, 2019, 2:38pm UTC](https://discuss.elastic.co/t/failed-to-parse-date-field-error/194445/2 "2019-08-08T14:38:35Z")

</div>

> [@ssi](#):
>
> 08/07/2019 12:32:32

I think adding a template is the right approach, but none of the formats you have in your template match that. Try adding 'MM/dd/yyyy HH:mm:ss' in dynamic\_date\_formats.

---

<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:** [September 5, 2019, 2:38pm UTC](https://discuss.elastic.co/t/failed-to-parse-date-field-error/194445/3 "2019-09-05T14:38:39Z")

</div>

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