# Log stash

**URL:** <https://discuss.elastic.co/t/log-stash/147639>\
**Category:** Logstash\
**Created:** [September 6, 2018, 10:42pm UTC](https://discuss.elastic.co/t/log-stash/147639 "2018-09-06T22:42:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![satish161418](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@satish161418](https://discuss.elastic.co/u/satish161418)\
**Post date:** [September 6, 2018, 10:42pm UTC](https://discuss.elastic.co/t/log-stash/147639/1 "2018-09-06T22:42:39Z")

</div>

i Have logs with three different line like in message,out message and Error.  
Have written 3 grok patterns for parsing to kibana.pat1,pat2,pat 3.  
How to write a logstash if loop to parse if it is in message take pat1 ,if it is out message take pat2 and if it is error message take pat 3.

Please help.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 6, 2018, 11:20pm UTC](https://discuss.elastic.co/t/log-stash/147639/2 "2018-09-06T23:20:08Z")

</div>

It's super helpful if your topic titles are a summary of the problem, not just the word "Log stash". It doesn't really entice anyone to look at your topic and help.

---

<div class="post-metadata">

**Author:** ![satish161418](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@satish161418](https://discuss.elastic.co/u/satish161418)\
**Post date:** [September 7, 2018, 3:11am UTC](https://discuss.elastic.co/t/log-stash/147639/3 "2018-09-07T03:11:05Z")

</div>

thank you.i will correct myself

---

<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 7, 2018, 4:18am UTC](https://discuss.elastic.co/t/log-stash/147639/4 "2018-09-07T04:18:09Z")

</div>

Why not just try all the grok expressions? The documentation of the grok filter's `match` option shows the syntax for listing multiple expressions in the same filter.

---

<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 5, 2018, 4:18am UTC](https://discuss.elastic.co/t/log-stash/147639/5 "2018-10-05T04:18:10Z")

</div>

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