# \_grokparsefailure general exception handling?

**URL:** <https://discuss.elastic.co/t/-grokparsefailure-general-exception-handling/80143>\
**Category:** Logstash\
**Created:** [March 27, 2017, 2:02pm UTC](https://discuss.elastic.co/t/-grokparsefailure-general-exception-handling/80143 "2017-03-27T14:02:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zillag/32/10505_2.png) [@ZillaG](https://discuss.elastic.co/u/ZillaG)\
**Post date:** [March 27, 2017, 2:02pm UTC](https://discuss.elastic.co/t/-grokparsefailure-general-exception-handling/80143/1 "2017-03-27T14:02:46Z")

</div>

I've perused the forum regarding \_grokparsefailure, but they all ask about solving specific log messages. I have a general question.

As I form my Grok filters for one of our applications, I expect to get \_grokparsefailure since my filters are incomplete. As I get them, I want to

- Mutate one of the fields
- Send the log message to Elasticsearch
- Search for the index with the mutated field in Kibana

So this will be the **last** filter I'll have

```
filter {
  if "_grokparsefailure" in [tags] {
    mutate {
      remove_tag => ["_grokparsefailure"]
      replace => {
       "customer" => "grokparsefailure"
      }
    }
  }
}

```

Then my output filter looks like

```
output {
  stdout {
    codec => rubydebug
  }

  elasticsearch {
    # other options
    index => "logstash-%{customer}-%{+YYYY.MM.dd}"
  }
}

```

I can then just form a "logstash-grokparsefailure-\*" index in Kibana.

How does this strategy sound?

---

<div class="post-metadata">

**Author:** ![ZillaG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zillag/32/10505_2.png) [@ZillaG](https://discuss.elastic.co/u/ZillaG)\
**Post date:** [March 27, 2017, 6:08pm UTC](https://discuss.elastic.co/t/-grokparsefailure-general-exception-handling/80143/2 "2017-03-27T18:08:34Z")

</div>

This approach worked well for me. I can now create a "logstash-grokparsefailure-\*" index in Kibana and see all my messages with \_grokparsefailure.

---

<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:** [April 24, 2017, 6:08pm UTC](https://discuss.elastic.co/t/-grokparsefailure-general-exception-handling/80143/3 "2017-04-24T18:08:41Z")

</div>

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