# GrokPraseFailure - JSON log - Success on Grokdebugger

**URL:** <https://discuss.elastic.co/t/grokprasefailure-json-log-success-on-grokdebugger/285282>\
**Category:** Logstash\
**Created:** [September 27, 2021, 9:18pm UTC](https://discuss.elastic.co/t/grokprasefailure-json-log-success-on-grokdebugger/285282 "2021-09-27T21:18:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Athul\_Devkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/athul_devkar/32/93241_2.png) [@Athul\_Devkar](https://discuss.elastic.co/u/Athul_Devkar)\
**Post date:** [September 27, 2021, 9:18pm UTC](https://discuss.elastic.co/t/grokprasefailure-json-log-success-on-grokdebugger/285282/1 "2021-09-27T21:18:32Z")

</div>

I am facing issues while trying to parse this log. I have tried multiple options but nothing seems to work. No error message in the logs, except for this \_grokprasefailure tag in the records. Can you please help with what I am missing here?  
When I try it in GrokDebugger, it works all fine.

Any help is appreciated.

```auto
Auto route reason : {"opportunityId":"0042f00000Kttt","accountNumber":"999999999999999","agId":"0051H0001111IWYqTTT","division":"US","errorCode":"EC-109","errorName":"GetDetails Not Found","errorDescription":"SiteDetails Not Found"}

```

```auto
filter {
      
    json {
        source => message
        add_field => {
            "region" => "us-east-1"
        }
    }
	if [message] =~ /Auto route reason/ {
		grok {
			match => {"message" =>'%{CISCO_REASON} : {"opportunityId":"%{DATA:opportunityId}",%{GREEDYDATA:Greedymessage}}'}
        }
    }
}

```

---

<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:** [September 27, 2021, 9:52pm UTC](https://discuss.elastic.co/t/grokprasefailure-json-log-success-on-grokdebugger/285282/2 "2021-09-27T21:52:59Z")

</div>

```
input { generator { count => 1 lines => ['Auto route reason : {"opportunityId":"0042f00000Kttt","accountNumber":"999999999999999","agId":"0051H0001111IWYqTTT","division":"US","errorCode":"EC-109","errorName":"GetDetails Not Found","errorDescription":"SiteDetails Not Found"}'] } }
filter {
    if [message] =~ /Auto route reason/ {
        grok { match => {"message" =>'%{CISCO_REASON} : {"opportunityId":"%{DATA:opportunityId}",%{GREEDYDATA:Greedymessage}}'} }
    }
}

```

This works fine for me

```
"opportunityId" => "0042f00000Kttt",
"Greedymessage" => "\"accountNumber\":\"999999999999999\",\"agId\":\"0051H0001111IWYqTTT\",\"division\":\"US\",\"errorCode\":\"EC-109\",\"errorName\":\"GetDetails Not Found\",\"errorDescription\":\"SiteDetails Not Found\"",
```

---

<div class="post-metadata">

**Author:** ![Athul\_Devkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/athul_devkar/32/93241_2.png) [@Athul\_Devkar](https://discuss.elastic.co/u/Athul_Devkar)\
**Post date:** [September 27, 2021, 10:14pm UTC](https://discuss.elastic.co/t/grokprasefailure-json-log-success-on-grokdebugger/285282/3 "2021-09-27T22:14:52Z")

</div>

Thanks for your response.

However, this one doesn't work for me. Any reason or anything I can do to fix this?

![image](https://us1.discourse-cdn.com/elastic/original/3X/3/4/348917fd3ef927816db3703584fd6b09cd76ae23.png)

---

<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:** [September 27, 2021, 10:48pm UTC](https://discuss.elastic.co/t/grokprasefailure-json-log-success-on-grokdebugger/285282/4 "2021-09-27T22:48:15Z")

</div>

I am puzzled why you would not have a \_jsonparsefailure tag on the event, since the [message] field is not valid JSON. I suspect you are not running the configuration that you think you are.

---

<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:** [October 25, 2021, 10:48pm UTC](https://discuss.elastic.co/t/grokprasefailure-json-log-success-on-grokdebugger/285282/5 "2021-10-25T22:48:35Z")

</div>

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