# Grok Pattern for Specific words in side message field

**URL:** <https://discuss.elastic.co/t/grok-pattern-for-specific-words-in-side-message-field/156414>\
**Category:** Logstash\
**Created:** [November 13, 2018, 8:37am UTC](https://discuss.elastic.co/t/grok-pattern-for-specific-words-in-side-message-field/156414 "2018-11-13T08:37:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![satyaban](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@satyaban](https://discuss.elastic.co/u/satyaban)\
**Post date:** [November 13, 2018, 8:37am UTC](https://discuss.elastic.co/t/grok-pattern-for-specific-words-in-side-message-field/156414/1 "2018-11-13T08:37:01Z")

</div>

I have some log file having pattern like  
Platform = iOS || iOSRegdID = 1034 || Status = Login || LoggedIn successfully  
Platform = Android || AndroidRegdID = 1024 || **Status = Login** || LoggedIn successfully  
Platform = iOS || iOSRegdID = 104 || Status = Login || LoggedIn successfully  
Platform = Android || AndroidRegdID = 1024 || Logout successfully  
Platform = iOS || iOSRegdID = 1044 || Status = Login || LoggedIn successfully

Here when **_Plat form is iOS second field is RegID where as if platform is android then it is AndroidRegID_** so how can I write grok pattern for same to get values for RegID

Again most wired thing when app logout then **Status filed is absent** so how to handle all those scenario sothat I can have a proper dashboard at Kibana.

Kindly help whether it is possible or not .

---

<div class="post-metadata">

**Author:** ![bigphil](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@bigphil](https://discuss.elastic.co/u/bigphil)\
**Post date:** [November 14, 2018, 4:34am UTC](https://discuss.elastic.co/t/grok-pattern-for-specific-words-in-side-message-field/156414/2 "2018-11-14T04:34:11Z")

</div>

The kv filter looks better suited to parse your log lines than the grok 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:** [December 12, 2018, 4:45am UTC](https://discuss.elastic.co/t/grok-pattern-for-specific-words-in-side-message-field/156414/3 "2018-12-12T04:45:55Z")

</div>

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