# Logstash Errors mapper\_parsing\_exception vs illegal\_argument\_exception

**URL:** <https://discuss.elastic.co/t/logstash-errors-mapper-parsing-exception-vs-illegal-argument-exception/236783>\
**Category:** Logstash\
**Created:** [June 11, 2020, 8:56pm UTC](https://discuss.elastic.co/t/logstash-errors-mapper-parsing-exception-vs-illegal-argument-exception/236783 "2020-06-11T20:56:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akrzos](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@akrzos](https://discuss.elastic.co/u/akrzos)\
**Post date:** [June 11, 2020, 8:56pm UTC](https://discuss.elastic.co/t/logstash-errors-mapper-parsing-exception-vs-illegal-argument-exception/236783/1 "2020-06-11T20:56:10Z")

</div>

I am trying to understand the difference between these two errors:

> [2020-06-05T13:51:34,267][WARN][logstash.outputs.elasticsearch][filebeat] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"filebeat-ilm-6.5.1", :routing=\>nil, :\_type=\>"\_doc"}, #LogStash::Event:0x7cd8e6f9], :response=\>{"index"=\>{"\_index"=\>"filebeat-ilm-6.5.1-2020.06.05-000006", "\_type"=\>"\_doc", "\_id"=\>"bijAhHIB6QPGMv6USiAf", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"object mapping for [kubernetes.labels.app] tried to parse field [app] as object, but found a concrete value"}}}}

and this error:

> {"level":"WARN","loggerName":"logstash.outputs.elasticsearch","timeMillis":1591902736087,"thread":"[filebeat]\>worker1","logEvent":{"message":"Could not index event to Elasticsearch.","status":400,"action":["index",{"\_index":"filebeat-ilm-6.5.1","\_type":"\_doc"},{"metaClass":{"metaClass":{"metaClass":{"action":"["index", {:\_id=\>nil, :\_index=\>"filebeat-ilm-6.5.1", :routing=\>nil, :\_type=\>"\_doc"}, #LogStash::Event:0x3b9ff5c7]","response":{"index":{"\_index":"filebeat-ilm-6.5.1-2020.06.11-000015","\_type":"\_doc","_id":"P9nMpHIBUCo\_PZZ1DhC_","status":400,"error":{"type":"illegal\_argument\_exception","reason":"mapper [logEvent.action] of different type, current\_type [keyword], merged\_type [ObjectMapper]"}}}}}}}]}}

The first one appears to be a `mapper_parsing_exception` as the 2nd is a `illegal_argument_exception`.

The first makes sense as we have had documents indexed with the field `kubernetes.labels.app` as a string, then on rollover a document was indexed with an object nested in the `kubernetes.labels.app` filed instead of a string causing the mapper parsing exception.

Why isn't the second error message a `mapper_parsing_exception` as it appears to be the same issue but with field `logEvent.action`?

---

<div class="post-metadata">

**Author:** ![Rahul\_Kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_kumar4/32/67369_2.png) [@Rahul\_Kumar4](https://discuss.elastic.co/u/Rahul_Kumar4)\
**Post date:** [June 11, 2020, 9:13pm UTC](https://discuss.elastic.co/t/logstash-errors-mapper-parsing-exception-vs-illegal-argument-exception/236783/2 "2020-06-11T21:13:00Z")

</div>

> [@akrzos](#):
>
> Why isn't the second error message a `mapper_parsing_exception` as it appears to be the same issue but with field `logEvent.action` ?

That's an interesting observation. Searching a bit reveals this - ["illegal\_argument\_exception" for field starting or ending with a [.] · Issue #28890 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/28890)

Perhaps in the second case your input argument itself is ambiguous as explained in that link above but the trace still points to a mapping error since that is what it resolves to eventually.

Seeing the actual field value that you are trying to index could reveal more.

---

<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:** [June 11, 2020, 10:58pm UTC](https://discuss.elastic.co/t/logstash-errors-mapper-parsing-exception-vs-illegal-argument-exception/236783/3 "2020-06-11T22:58:23Z")

</div>

I believe the first exception indicates that in elasticsearch the field is an object, but you are trying to insert a string, and the second indicates that in elasticsearch the field is a string, but you are trying to insert an object.

---

<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:** [July 9, 2020, 10:58pm UTC](https://discuss.elastic.co/t/logstash-errors-mapper-parsing-exception-vs-illegal-argument-exception/236783/4 "2020-07-09T22:58:35Z")

</div>

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