# Grok Parse Failure - Filebeat -\> Logstash

**URL:** <https://discuss.elastic.co/t/grok-parse-failure-filebeat-logstash/185259>\
**Category:** Logstash\
**Created:** [June 11, 2019, 5:57pm UTC](https://discuss.elastic.co/t/grok-parse-failure-filebeat-logstash/185259 "2019-06-11T17:57:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdobsonbcm](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bdobsonbcm](https://discuss.elastic.co/u/bdobsonbcm)\
**Post date:** [June 11, 2019, 5:57pm UTC](https://discuss.elastic.co/t/grok-parse-failure-filebeat-logstash/185259/1 "2019-06-11T17:57:27Z")

</div>

I apologize in that I may have missed the correct part in the documentation on this but have been getting nowhere so far this week.

I have a device which I believe is writing fairly simple JSON entries to a log.

Filebeat configuration:

```
- type: log

  # Change to true to enable this input configuration.
  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /var/log/gateway*

  json:
    message_key: message
    keys_under_root: true

```

And I have this on Logstash:

```
filter {
    json {
        source => "message"
        target => "parsedJson"
    }
}

```

The messages from the logs look something like:

`Jun 11 10:48:56 device01 ssg: {"package":"com.bench.server.transport.http.HttpTransportModule","level":"INFO","log":{"message":"2401: Stopping HTTPS listener: Node HTTPS (2124) (#699e156f7fc4df052c4af880a521f730,v0) on port 2124"},"time":"2019-06-11T10:48:56.680-0700"}`

However, I am only getting \_jsonparsefailure in Kibana when viewing. I have a feeling I'm missing something simple here.

---

<div class="post-metadata">

**Author:** ![bdobsonbcm](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bdobsonbcm](https://discuss.elastic.co/u/bdobsonbcm)\
**Post date:** [June 11, 2019, 6:08pm UTC](https://discuss.elastic.co/t/grok-parse-failure-filebeat-logstash/185259/2 "2019-06-11T18:08:21Z")

</div>

I enabled debug and see the issue, I'm just not certain the standard/accepted way to work around this as I cannot change the JSON output itself:

`[2019-06-11T11:04:58,523][WARN][logstash.filters.json] Error parsing json {:source=>"message", :raw=>"Jun 11 11:04:56 device01 ssg: {\"package\":\"com.bench.server\",\"level\":\"FINE\",\"log\":{\"message\":\"Server Closed\"},\"time\":\"2019-06-11T11:04:56.240-0700\"}", :exception=>#<LogStash::Json::ParserError: Unrecognized token 'Jun': was expecting ('true', 'false' or 'null')`

---

<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:** [June 11, 2019, 6:39pm UTC](https://discuss.elastic.co/t/grok-parse-failure-filebeat-logstash/185259/3 "2019-06-11T18:39:22Z")

</div>

```
    dissect { mapping => { "message" => "%{[@metadata][ts]} %{+[@metadata][ts]} %{+[@metadata][ts]} %{devicename} %{something}: %{[@metadata][json]}" } }
    date { match => ["[@metadata][ts]", "MMM dd HH:mm:ss" ] }
    json { source => "[@metadata][json]" }
```

---

<div class="post-metadata">

**Author:** ![bdobsonbcm](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bdobsonbcm](https://discuss.elastic.co/u/bdobsonbcm)\
**Post date:** [June 11, 2019, 6:50pm UTC](https://discuss.elastic.co/t/grok-parse-failure-filebeat-logstash/185259/4 "2019-06-11T18:50:44Z")

</div>

Works like a charm and I've learned something very valuable here.

Thank you very much.

---

<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 9, 2019, 6:50pm UTC](https://discuss.elastic.co/t/grok-parse-failure-filebeat-logstash/185259/5 "2019-07-09T18:50:55Z")

</div>

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