# Logstash 6: Log message on Could not index event to Elasticsearch exception

**URL:** https://discuss.elastic.co/t/logstash-6-log-message-on-could-not-index-event-to-elasticsearch-exception/175863
**Category:** Logstash
**Created:** [April 8, 2019, 2:54pm UTC](https://discuss.elastic.co/t/logstash-6-log-message-on-could-not-index-event-to-elasticsearch-exception/175863 "2019-04-08T14:54:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![filipe.ferreira](https://avatars.discourse-cdn.com/v4/letter/f/4af34b/32.png) [@filipe.ferreira](https://discuss.elastic.co/u/filipe.ferreira)
#### Post date: [April 8, 2019, 2:54pm UTC](https://discuss.elastic.co/t/logstash-6-log-message-on-could-not-index-event-to-elasticsearch-exception/175863/1 "2019-04-08T14:54:51Z")

</div>

Hi,

In logstash 5, when we had a "Could not index event to Elasticsearch", logstash logged the event with the message that caused the exception.  
Ex:  
[2019-04-08T14:47:58,939][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"indexZZZ", :\_type=\>"typeL", :\_routing=\>nil}, 2019-04-08T14:47:52.100Z SERVERX {"EventSeverity":"Verbose" ....}], :response=\>{"index"=\>{"\_index"=\>"indexZZZ", "\_type"=\>"typeL", "\_id"=\>"sdfsdfsdfsdf", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"mapper [field] of different type, current\_type [long], merged\_type [text]"}}}}  
The messaged tried to insert in elasticsearch was "2019-04-08T14:47:52.100Z SERVERX {"EventSeverity":"Verbose" ....}"

In logstash 6, the same errors are logging in the following way:  
Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"indexAAA", :\_type=\>"doc", :routing=\>nil}, #LogStash::Event:0x70f59e7f], :response=\>{"index"=\>{"\_index"=\>"indexAAA", "\_type"=\>"doc", "\_id"=\>"tmBE\_WkBDnuvom78Msig", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse [field]", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"For input string: "aaaaaaa""}}}}}

The log message cannot be retrieve from the log, it's "#LogStash::Event:0x70f59e7f". is it possible to force logstash to log the message? How?

Best Regards,  
Filipe Ferreira.

---

<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: [May 6, 2019, 2:54pm UTC](https://discuss.elastic.co/t/logstash-6-log-message-on-could-not-index-event-to-elasticsearch-exception/175863/2 "2019-05-06T14:54:55Z")

</div>

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