# Grokparsefailure in logstash when consuming beats

**URL:** <https://discuss.elastic.co/t/grokparsefailure-in-logstash-when-consuming-beats/99891>\
**Category:** Logstash\
**Created:** [September 8, 2017, 7:48pm UTC](https://discuss.elastic.co/t/grokparsefailure-in-logstash-when-consuming-beats/99891 "2017-09-08T19:48:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsmithlea](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@bsmithlea](https://discuss.elastic.co/u/bsmithlea)\
**Post date:** [September 8, 2017, 7:48pm UTC](https://discuss.elastic.co/t/grokparsefailure-in-logstash-when-consuming-beats/99891/1 "2017-09-08T19:48:49Z")

</div>

I am seeing \_grokparsefailure tags in my output from logstash even though all the fields are getting values. My input is from a filebeat source. Here is som json output from my filebeat.

My logstash pipeline config looks like this

```
input {
    beats {
        port => "10002"
    }
}
filter {
    grok {
        match => {
            "message" => "%{TIMESTAMP_ISO8601:server_time} (\[\s*[^]]+\] )?%{WORD:log_level}"
        }
    }
}
output {
    stdout { codec => rubydebug }
}

```

My filebeat source is configured to collect stacktraces into a multiline message in order to capture stack traces. This is the configuration section of filebeat.

```
multiline.pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}
multiline.negate: true
multiline.match: after

```

Here is some sample debug output from my filebeat.

```
2017/09/08 18:57:21.219082 client.go:214: DBG Publish: {
  "@timestamp": "2017-09-08T18:57:16.173Z",
  "beat": {
     "hostname": "Newton.local",
     "name": "Newton.local",
     "version": "5.5.2"
   },
  "input_type": "log",
  "message": "2017-09-06 15:05:00,044 [Session Task-2] ERROR ca.foo.FeedImportRequestMessageListener.onMessage(63): - ### Before FeedMessageStatus.instance().close()",
  "offset": 737873,
  "source": "/bar/logs/focus.log",
  "type": "log"
}

```

Output from logstash correctly parses the **server\_time** and **log\_level** fields, but there is a **\_grokparsefailure** tag anyway. Is this because of the multiline settings on the filebeat?

I do not get the tag if I feed the **message** field contents to logstash directly.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 11, 2017, 8:53pm UTC](https://discuss.elastic.co/t/grokparsefailure-in-logstash-when-consuming-beats/99891/2 "2017-09-11T20:53:53Z")

</div>

Shouldn't `[^]]` instead be `[^\]]`? Anyway, build your grok expressions gradually. Start with the simplest possible (e.g. `^%{TIMESTAMP_ISO8601:server_time}`) and verify that it works. Then append additional tokens to your expression.

---

<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 17, 2017, 2:21pm UTC](https://discuss.elastic.co/t/grokparsefailure-in-logstash-when-consuming-beats/99891/4 "2017-10-17T14:21:07Z")

</div>

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