# Illegal\_argument\_exception mapping dates

**URL:** <https://discuss.elastic.co/t/illegal-argument-exception-mapping-dates/124513>\
**Category:** Logstash\
**Created:** [March 19, 2018, 9:14am UTC](https://discuss.elastic.co/t/illegal-argument-exception-mapping-dates/124513 "2018-03-19T09:14:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ventrca](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@ventrca](https://discuss.elastic.co/u/ventrca)\
**Post date:** [March 19, 2018, 9:14am UTC](https://discuss.elastic.co/t/illegal-argument-exception-mapping-dates/124513/1 "2018-03-19T09:14:37Z")

</div>

Hi, I've this simple filter to parse data, the problem is that **sometimes** logs are are saved in ES but are not correctly mapped.

```
date{

                        match => ["acc-log-timestamp", "yyyy-MM-dd HH:mm:ss", "ISO8601"]
                        target => "acc-log-timestamp"
}

```

The error I found in ES is:

```
[2018-03-18T02:00:04,001][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {
:status=>400,
:action=>["index", {:_id=>"300370831", :_index=>"logstash-2018.03.18", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x2f1342db>],
:response=>{"index"=>{"_index"=>"logstash-2018.03.18", "_type"=>"doc", "_id"=>"300370831", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"mapper [acc-log-timestamp] of different type, current_type[text],merged_type [date]"}}}}

```

I looked for that log in ES and the acc-log-timestamp value seems correct.

```
"acc-log-timestamp": "2018-03-17T23:20:14.000Z",
"@timestamp": "2018-03-18T23:30:16.017Z",

```

My template is the default one, I didn't change it.

---

<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 16, 2018, 9:14am UTC](https://discuss.elastic.co/t/illegal-argument-exception-mapping-dates/124513/2 "2018-04-16T09:14:44Z")

</div>

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