# Two different grok pattern in a single config file

**URL:** <https://discuss.elastic.co/t/two-different-grok-pattern-in-a-single-config-file/58892>\
**Category:** Logstash\
**Created:** [August 25, 2016, 6:34am UTC](https://discuss.elastic.co/t/two-different-grok-pattern-in-a-single-config-file/58892 "2016-08-25T06:34:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshita\_nolakha](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@harshita\_nolakha](https://discuss.elastic.co/u/harshita_nolakha)\
**Post date:** [August 25, 2016, 6:34am UTC](https://discuss.elastic.co/t/two-different-grok-pattern-in-a-single-config-file/58892/1 "2016-08-25T06:34:33Z")

</div>

can i use the two different grok pattern in single config file?

---

<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:** [August 25, 2016, 6:55am UTC](https://discuss.elastic.co/t/two-different-grok-pattern-in-a-single-config-file/58892/2 "2016-08-25T06:55:27Z")

</div>

Are you asking

- if you can have two grok filters in the same Logstash configuration, or
- if you can have two grok expressions in the same grok filter, or
- if you can define two grok patterns in the same grok pattern file?

Either way the answer is yes.

---

<div class="post-metadata">

**Author:** ![harshita\_nolakha](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@harshita\_nolakha](https://discuss.elastic.co/u/harshita_nolakha)\
**Post date:** [August 25, 2016, 7:25am UTC](https://discuss.elastic.co/t/two-different-grok-pattern-in-a-single-config-file/58892/3 "2016-08-25T07:25:40Z")

</div>

yes

Actually i want to ask i have a log file in this two type of log pattern.  
so i have created two type of grok pattern . and i want to define both of grok pattern in same config file .

---

<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 6, 2017, 4:41am UTC](https://discuss.elastic.co/t/two-different-grok-pattern-in-a-single-config-file/58892/4 "2017-07-06T04:41:42Z")

</div>

Closed on July 6, 2017, 4:41am UTC


