# Grok Filter not Matching multiple filters

**URL:** <https://discuss.elastic.co/t/grok-filter-not-matching-multiple-filters/90721>\
**Category:** Logstash\
**Created:** [June 24, 2017, 5:28pm UTC](https://discuss.elastic.co/t/grok-filter-not-matching-multiple-filters/90721 "2017-06-24T17:28:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mussa572](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mussa572](https://discuss.elastic.co/u/mussa572)\
**Post date:** [June 24, 2017, 5:28pm UTC](https://discuss.elastic.co/t/grok-filter-not-matching-multiple-filters/90721/1 "2017-06-24T17:28:00Z")

</div>

Dear Team

I have following grok filter which matches 2 different fields from CSV file . However I have noticed that Logstash ignores the second line ( excuses) when sending the traffic to Elasticsearch . In case where the IP is not present in the CSV then the second filter works . As a work around I have created two separate grok filters and every thing works as expected .

I was wondering if there any issue with my filter sentence where both filters not working on one grok filter or it is a expected behaviour ?

grok {

match =\> ["ip:port", "%?/%{IP:src\_ip}?:%{NUMBER:src\_port}"],

match =\> ["excuses", "%{WORD:excuses\_type\_letter}=%{NUMBER:excuses\_type\_value}"]

}

* * *

Work Around

grok {

match =\> ["ip:port", "%?/%{IP:src\_ip}?:%{NUMBER:src\_port}"]

}

grok {  
match =\> ["excuses", "%{WORD:excuses\_type\_letter}=%{NUMBER:excuses\_type\_value}"  
]

}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 25, 2017, 6:52am UTC](https://discuss.elastic.co/t/grok-filter-not-matching-multiple-filters/90721/2 "2017-06-25T06:52:17Z")

</div>

If you want all listed expressions to always be evaluated for a grok filter, you must set [break\_on\_match](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html#plugins-filters-grok-break_on_match) to `false`. By default this is set to `true`, which means that evaluation of grok patterns will stop after the first match.

---

<div class="post-metadata">

**Author:** ![mussa572](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mussa572](https://discuss.elastic.co/u/mussa572)\
**Post date:** [June 26, 2017, 11:35am UTC](https://discuss.elastic.co/t/grok-filter-not-matching-multiple-filters/90721/3 "2017-06-26T11:35:54Z")

</div>

Thanks Christian

---

<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 24, 2017, 11:35am UTC](https://discuss.elastic.co/t/grok-filter-not-matching-multiple-filters/90721/4 "2017-07-24T11:35:54Z")

</div>

Closed on July 24, 2017, 11:35am UTC

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