# Trapping mapper\_parsing\_exception original messages

**URL:** https://discuss.elastic.co/t/trapping-mapper-parsing-exception-original-messages/176975
**Category:** Logstash
**Created:** [April 15, 2019, 9:17pm UTC](https://discuss.elastic.co/t/trapping-mapper-parsing-exception-original-messages/176975 "2019-04-15T21:17:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jeffkirk1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeffkirk1/32/8080_2.png) [@jeffkirk1](https://discuss.elastic.co/u/jeffkirk1)
#### Post date: [April 15, 2019, 9:17pm UTC](https://discuss.elastic.co/t/trapping-mapper-parsing-exception-original-messages/176975/1 "2019-04-15T21:17:09Z")

</div>

Hi there. I am debugging a Logstash filter pipeline that occasionally throws an Elasticsearch indexing error.

Long story short is that I am trying to parse a log message from an application into key-value pairs using a Ruby filter. Sometimes the log message is broken into key/value pairs incorrectly, and a string value is returned for a field that should be a Long.

I don't need to go into too much detail; I'm just looking for a way to make Logstash trap the mapper\_parsing\_exception and save the original event data to another index or to a Kafka topic or a file... really, to anything that lets me examine the original event and try to work backward to find my bug.

Is there such a mechanism in Logstash? I'm currently using version 6.7.1.

Thanks!

Jeff Kirk

---

<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: [April 15, 2019, 9:22pm UTC](https://discuss.elastic.co/t/trapping-mapper-parsing-exception-original-messages/176975/2 "2019-04-15T21:22:15Z")

</div>

Are you aware of [dead letter queues](https://www.elastic.co/guide/en/logstash/current/dead-letter-queues.html)?

---

<div class="post-metadata">

### Author: ![jeffkirk1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeffkirk1/32/8080_2.png) [@jeffkirk1](https://discuss.elastic.co/u/jeffkirk1)
#### Post date: [April 16, 2019, 12:25am UTC](https://discuss.elastic.co/t/trapping-mapper-parsing-exception-original-messages/176975/3 "2019-04-16T00:25:14Z")

</div>

Hi Badger,

That looks perfect! Have never used that feature up to now. Thanks!

Jeff

---

<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 14, 2019, 12:25am UTC](https://discuss.elastic.co/t/trapping-mapper-parsing-exception-original-messages/176975/4 "2019-05-14T00:25:17Z")

</div>

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