# Logstash grok parsing not working

**URL:** <https://discuss.elastic.co/t/logstash-grok-parsing-not-working/76200>\
**Category:** Logstash\
**Created:** [February 23, 2017, 11:16am UTC](https://discuss.elastic.co/t/logstash-grok-parsing-not-working/76200 "2017-02-23T11:16:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [February 23, 2017, 11:16am UTC](https://discuss.elastic.co/t/logstash-grok-parsing-not-working/76200/1 "2017-02-23T11:16:39Z")

</div>

Hi,

I use ELK GA 5.0.0 and I read from Kafka topic. I have a log entry like below;

```
2017-02-22 10:23:53 - - 0.000 304 '425B39368AE7AF1B0D7230B6413ACC6B' GET /qwe/rty/ghj.js http-abc-1234-def-567 192.168.0.1 192.168.0.2 'abcd,abcd,abcd' - - 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1736.2 Safari/537.36'

```

Here is my Logstash configuration. Some fields may have either `'data'` or just `-` so i used the config like this;

```
grok{
	match => { "message" => "%{NOTSPACE:fielda} %{NOTSPACE:fieldb} ('%{NOTSPACE:fieldc}'|%{NOTSPACE:fieldc}) %{NOTSPACE:fieldd} %{NOTSPACE:fielde} %{NOTSPACE:fieldf} ('%{GREEDYDATA:fieldg}'|%{NOTSPACE:fieldg}) %{NOTSPACE:fieldh} %{NOTSPACE:fieldh} %{NOTSPACE:fieldi} ('%{NOTSPACE:fieldj}'|%{NOTSPACE:fieldj}) %{NOTSPACE:fieldk} ('%{GREEDYDATA:fieldl}'|%{NOTSPACE:fieldl}) ('%{GREEDYDATA:fieldm}'|%{NOTSPACE:fieldm}) ('%{GREEDYDATA:fieldn}'|%{NOTSPACE:fieldn}) ('%{GREEDYDATA:fieldo}'|%{NOTSPACE:fieldo})" }
}

```

But I am able to see only `message` in Kibana, the entries are not getting sliced. Why is this happening? How can I fix this?

---

<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:** [February 23, 2017, 12:17pm UTC](https://discuss.elastic.co/t/logstash-grok-parsing-not-working/76200/2 "2017-02-23T12:17:14Z")

</div>

Start with the simplest possible expression, `^%{NOTSPACE:fielda}`. Verify that that works. Then add the next token (`^%{NOTSPACE:fielda} %{NOTSPACE:fieldb}`). Does that work? Continue until it stops working.

---

<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:** [March 23, 2017, 12:17pm UTC](https://discuss.elastic.co/t/logstash-grok-parsing-not-working/76200/3 "2017-03-23T12:17:16Z")

</div>

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