# Error logging: is it possible to customise mapper\_parsing\_exception logs?

**URL:** https://discuss.elastic.co/t/error-logging-is-it-possible-to-customise-mapper-parsing-exception-logs/188514
**Category:** Logstash
**Created:** [July 2, 2019, 12:43pm UTC](https://discuss.elastic.co/t/error-logging-is-it-possible-to-customise-mapper-parsing-exception-logs/188514 "2019-07-02T12:43:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rozling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rozling/32/16401_2.png) [@rozling](https://discuss.elastic.co/u/rozling)
#### Post date: [July 2, 2019, 12:43pm UTC](https://discuss.elastic.co/t/error-logging-is-it-possible-to-customise-mapper-parsing-exception-logs/188514/1 "2019-07-02T12:43:21Z")

</div>

I have a central index which many services write logs to.

However when I get unexpected data (e.g. a date instead of a boolean) the log looks like this:  
[2019-07-02T11:36:32,836][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"my-services-write", :\_type=\>"\_doc", :routing=\>nil}, #LogStash::Event:0x35052f4b], :response=\>{"index"=\>{"\_index"=\>"my-services-000002", "\_type"=\>"\_doc", "\_id"=\>"bjF4smsB1cGh2-nB2IK8", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse field [params.valueDate] of type [boolean] in document with id 'bjF4smsB1cGh2-nB2IK8'", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Failed to parse value [2019-06-27T12:45:54.007+0000] as only [true] or [false] are allowed."}}}}}

Which is great, but doesn't tell me which service is logging the wrong data.

Is there a way to customise mapper\_parsing\_exceptions so they will show custom fields, i.e. the service name?

---

<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: [July 2, 2019, 1:11pm UTC](https://discuss.elastic.co/t/error-logging-is-it-possible-to-customise-mapper-parsing-exception-logs/188514/2 "2019-07-02T13:11:24Z")

</div>

> [@rozling](#):
>
> Is there a way to customise mapper\_parsing\_exceptions so they will show custom fields, i.e. the service name?

I don't think so, but you can send events that get a 400 response to a [dead-letter queue](https://www.elastic.co/guide/en/logstash/current/dead-letter-queues.html) and inspect them yourself to identify the source.

---

<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 30, 2019, 1:11pm UTC](https://discuss.elastic.co/t/error-logging-is-it-possible-to-customise-mapper-parsing-exception-logs/188514/3 "2019-07-30T13:11:44Z")

</div>

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