# Grok filter not filtering data

**URL:** <https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442>\
**Category:** Logstash\
**Created:** [October 18, 2017, 6:03pm UTC](https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442 "2017-10-18T18:03:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maddie0726](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@maddie0726](https://discuss.elastic.co/u/maddie0726)\
**Post date:** [October 18, 2017, 6:03pm UTC](https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442/1 "2017-10-18T18:03:27Z")

</div>

I have Elasticsearch, Logstash and Kibana all versions 5.6.2 configured and running on Windows 2012 R2. Some sample data I am trying to parse is: (filtered for sensitive info)

2017-09-18 00:00:01 Local4.Debug 00.00.00.0 Sep 18 2017 00:00:01: %ASA-0-000000: UDP request discarded from 00.00.00.00/00000 to COVERT:000.000.000.000/0000

the following is my grok pattern in my logstash config file reading from a .txt file:

grok {  
match =\> { "message" =\> "%{TIMESTAMP\_ISO8601:timestamp}%{SPACE}Local4.%{LOGLEVEL}%{SPACE}%{IP}%{SPACE}%{CISCOTIMESTAMP}: %%{CISCOTAG}%{GREEDYDATA}" }  
}

It parses in the grok debugger but in Kibana the whole entry shows up as message, not separate fields. It also auto-generates the time stamp to be current but I'm reading logs that are 24 hours old. Not sure what I have going on.

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [October 18, 2017, 6:07pm UTC](https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442/2 "2017-10-18T18:07:17Z")

</div>

If I test it on [http://grokdebug.herokuapp.com/](http://grokdebug.herokuapp.com/) it matches but when I enable 'Named Captures Only' I only see the timestamp. I am unsure if grok defaults to 'Named Captures Only', You might want to investigate this.

Good luck.  
Paul.

---

<div class="post-metadata">

**Author:** ![maddie0726](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@maddie0726](https://discuss.elastic.co/u/maddie0726)\
**Post date:** [October 18, 2017, 6:10pm UTC](https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442/3 "2017-10-18T18:10:36Z")

</div>

It looks like named captures only defaults to true, so how would I go about setting the boolean to false?

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [October 18, 2017, 6:15pm UTC](https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442/4 "2017-10-18T18:15:52Z")

</div>

I would guess something like this.

```
 filter {
      grok {
        named_captures_only => 'false'
        match => { "message" => "stuff" }
      }
    }
```

---

<div class="post-metadata">

**Author:** ![maddie0726](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@maddie0726](https://discuss.elastic.co/u/maddie0726)\
**Post date:** [October 18, 2017, 6:21pm UTC](https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442/5 "2017-10-18T18:21:47Z")

</div>

Worked, thank you!

---

<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:** [November 15, 2017, 6:25pm UTC](https://discuss.elastic.co/t/grok-filter-not-filtering-data/104442/6 "2017-11-15T18:25:10Z")

</div>

Closed on November 15, 2017, 6:25pm UTC

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