# Dynamic date field mapping problem

**URL:** <https://discuss.elastic.co/t/dynamic-date-field-mapping-problem/78078>\
**Category:** Elasticsearch\
**Created:** [March 10, 2017, 2:54am UTC](https://discuss.elastic.co/t/dynamic-date-field-mapping-problem/78078 "2017-03-10T02:54:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kilnyy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kilnyy/32/16248_2.png) [@kilnyy](https://discuss.elastic.co/u/kilnyy)\
**Post date:** [March 10, 2017, 2:54am UTC](https://discuss.elastic.co/t/dynamic-date-field-mapping-problem/78078/1 "2017-03-10T02:54:56Z")

</div>

Hi all,

When I am trying to insert date from logstash to elasticsearch, following error appears.

```auto
"error"=>{
    "type"=>"mapper_parsing_exception", 
    "reason"=>"failed to parse [data.time]", 
    "caused_by"=>{
        "type"=>"illegal_argument_exception", 
        "reason"=>"Invalid format: \"2017/03/09 07:19:17\" is malformed at \"/03/09 07:19:17\""
    }
}

```

When I insert `2017-03-09 07:19:17`, It will be successfully inserted as string.

Then I found that according to [https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html#date-detection](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html#date-detection), the default date format for `Dynamic field mapping` is `"yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"`.

However, according to [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/date.html#date](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/date.html#date), the default date format for parse looks like `"yyyy-MM-dd HH:mm:ss || yyyy-MM-dd"`.

So that It seems my data `2017/03/09 07:19:17` is recognized as `date` but can not parse by the default config.

I wonder if it is a bug of elasticsearch, or I misunderstanding the documentation?

Thanks!

---

<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:** [April 7, 2017, 2:55am UTC](https://discuss.elastic.co/t/dynamic-date-field-mapping-problem/78078/2 "2017-04-07T02:55:12Z")

</div>

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