# Resulting Error while indexing date values in elasticsearch?

**URL:** https://discuss.elastic.co/t/resulting-error-while-indexing-date-values-in-elasticsearch/67439
**Category:** Elasticsearch
**Created:** [November 29, 2016, 6:54am UTC](https://discuss.elastic.co/t/resulting-error-while-indexing-date-values-in-elasticsearch/67439 "2016-11-29T06:54:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)
#### Post date: [November 29, 2016, 6:54am UTC](https://discuss.elastic.co/t/resulting-error-while-indexing-date-values-in-elasticsearch/67439/1 "2016-11-29T06:54:06Z")

</div>

I Have created date\_withdrawn filed of type date in mapping.The problem was while I'm bulk indexing in some documents we have date\_withdrawn=" " and it is raising the following error.

```
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse [date_withdrawn]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse [date_withdrawn]",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "Invalid format: \"\""
    }
  },
  "status": 400
}

```

Please find and help me to accept date field with ""

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [November 29, 2016, 7:13am UTC](https://discuss.elastic.co/t/resulting-error-while-indexing-date-values-in-elasticsearch/67439/2 "2016-11-29T07:13:33Z")

</div>

Please format your code using `</>` icon. It will make your post more readable.

`""` is not a date and is not parseable.

Don't send the date instead of sending an empty field.

But you can change your mapping and use `ignore_malformed` field. See [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/ignore-malformed.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/ignore-malformed.html)

If you are using elasticsearch 5.0, you can also define an ingest pipeline to parse the date and in case of exception, remove the date field. But it's definitely easier to do that from your source instead of in elasticsearch.

---

<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: [December 27, 2016, 7:13am UTC](https://discuss.elastic.co/t/resulting-error-while-indexing-date-values-in-elasticsearch/67439/3 "2016-12-27T07:13:46Z")

</div>

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