# \_jsonparsefailure with grok in Logstash

**URL:** <https://discuss.elastic.co/t/jsonparsefailure-with-grok-in-logstash/223283>\
**Category:** Logstash\
**Created:** [March 12, 2020, 8:36am UTC](https://discuss.elastic.co/t/jsonparsefailure-with-grok-in-logstash/223283 "2020-03-12T08:36:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michielM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michielm/32/46127_2.png) [@michielM](https://discuss.elastic.co/u/michielM)\
**Post date:** [March 12, 2020, 8:36am UTC](https://discuss.elastic.co/t/jsonparsefailure-with-grok-in-logstash/223283/1 "2020-03-12T08:36:09Z")

</div>

Hi, I'm configuring a filter for my log and I am getting a \_jsonparsefailure in my tag, and I have no idea what's causing this. This is the filter I'm using.

```
    filter {
    if "atlassian-jira-perf" in [tags] {
    grok {
     match => { "message" =>"%{TIMESTAMP_ISO8601:timestamp} (?<instrument>[^\]*) ?%. {GREEDYDATA:log_message}" }
     tag_on_failure => ["no_match"]
  }
  if "no_match" not in [tags] {
    json {
      source => "log_message"
    }
  }
}
}

```

This is the log I'm trying to parse.  
2020-03-11 05:54:26,174 JMXINSTRUMENTS-Threading [{"timestamp":"1583906066","label":"Threading","ObjectName":"java.lang:type\u003dThreading","attributes":[{"name":"CurrentThreadUserTime","value":18600000000},{"name":"ThreadCount","value":152},{"name":"TotalStartedThreadCount","value":1138},{"name":"CurrentThreadCpuTime","value":20804323112},{"name":"PeakThreadCount","value":164},{"name":"DaemonThreadCount","value":136}]}]

And this is the outcome.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/8/d8dcaf2981dfacd81a98b4fed3248084bf39d301.png)

---

<div class="post-metadata">

**Author:** ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)\
**Post date:** [March 12, 2020, 8:53am UTC](https://discuss.elastic.co/t/jsonparsefailure-with-grok-in-logstash/223283/2 "2020-03-12T08:53:42Z")

</div>

Hi

We don't see it in the picture of text you posted (don't do that, copy and paste the text), is "`atlassian-jira-perf`" in your `[tags]`?

If not, `log_message` will not exist and your `json{}` filter will fail.

Hope this helps

---

<div class="post-metadata">

**Author:** ![michielM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michielm/32/46127_2.png) [@michielM](https://discuss.elastic.co/u/michielM)\
**Post date:** [March 12, 2020, 9:24am UTC](https://discuss.elastic.co/t/jsonparsefailure-with-grok-in-logstash/223283/3 "2020-03-12T09:24:30Z")

</div>

thanks for the response,  
Sorry for the bad image. atlassian-jira-perf is in the tags yes

---

<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 9, 2020, 9:24am UTC](https://discuss.elastic.co/t/jsonparsefailure-with-grok-in-logstash/223283/4 "2020-04-09T09:24:43Z")

</div>

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