# Mapper\_parsing\_exception & illegal\_argument\_exception

**URL:** <https://discuss.elastic.co/t/mapper-parsing-exception-illegal-argument-exception/166083>\
**Category:** Logstash\
**Created:** [January 29, 2019, 5:06am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-illegal-argument-exception/166083 "2019-01-29T05:06:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [January 29, 2019, 5:06am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-illegal-argument-exception/166083/1 "2019-01-29T05:06:20Z")

</div>

Hello World!

I've noticed following WARN message in my logstash's output:

`logstash | [2019-01-29T04:39:23,166][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=&gt;400, :action=&gt;["index", {:_id=&gt;nil, :_index=&gt;"logstash-2019.01.29", :_type=&gt;"doc", :routing=&gt;nil}, #&lt;LogStash::Event:0xef159cc&gt;], :response=&gt;{"index"=&gt;{"_index"=&gt;"logstash-2019.01.29", "_type"=&gt;"doc", "_id"=&gt;"Xbznl2gBT6G9g9fPlGz1", "status"=&gt;400, "error"=&gt;{"type"=&gt;"mapper_parsing_exception", "reason"=&gt;"failed to parse field [level] of type [long]", "caused_by"=&gt;{"type"=&gt;"illegal_argument_exception", "reason"=&gt;"For input string: \"error\""}}}}}`

* * *

per `GET /logstash-2019.01.29/_mapping` :

> ```
> "level" : {
> "type" : "long"
> },
> 
> ```

Some of my docs have key "`level`" with value from `1` through `6`, it is really should've been `byte` instead of `long` however logstash detected as `long`.

either way, how does one resolves this warning message?

Please advise.

---

<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:** [January 29, 2019, 1:13pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-illegal-argument-exception/166083/2 "2019-01-29T13:13:20Z")

</div>

The way I read that error message you are trying to put "error" into a field that is a long. I would not expect that to work.

---

<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:** [February 26, 2019, 1:13pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-illegal-argument-exception/166083/3 "2019-02-26T13:13:24Z")

</div>

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