# Empty date is not getting detected!

**URL:** https://discuss.elastic.co/t/empty-date-is-not-getting-detected/200003
**Category:** Elasticsearch
**Created:** [September 18, 2019, 12:35pm UTC](https://discuss.elastic.co/t/empty-date-is-not-getting-detected/200003 "2019-09-18T12:35:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adarshzphin](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@adarshzphin](https://discuss.elastic.co/u/adarshzphin)
#### Post date: [September 18, 2019, 12:35pm UTC](https://discuss.elastic.co/t/empty-date-is-not-getting-detected/200003/1 "2019-09-18T12:35:39Z")

</div>

I have below dynamic mapping for index "my\_index"  
PUT my\_index  
{  
"mappings": {  
"dynamic\_templates": [  
{  
"objects": {  
"match\_mapping\_type": "object",  
"mapping": {  
"type": "nested"  
}  
}  
}  
],  
"dynamic\_date\_formats": "yyyy-MM-dd||yyyy-MM-dd HH:mm:ss"  
}  
}

Now, when I am inserting data into es. It is giving me below error like:  
org.elasticsearch.hadoop.rest.EsHadoopRemoteException: mapper\_parsing\_exception: failed to parse field [raw\_derived.applications.accounts.dateclosed] of type [date] in document with id '02cf10ae-93c4-45a3-99bb-a0d01f24fa86'. Preview of field's value: '';org.elasticsearch.hadoop.rest.EsHadoopRemoteException: illegal\_argument\_exception: cannot parse empty date

there is field called "dateclosed". It is having value or sometimes empty values.  
How can I set dynamically in the mapping to ignore empty value from date fields?

Any suggestion would be helpful.

---

<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: [October 16, 2019, 12:35pm UTC](https://discuss.elastic.co/t/empty-date-is-not-getting-detected/200003/2 "2019-10-16T12:35:49Z")

</div>

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