# Break down log messages to keywords

**URL:** <https://discuss.elastic.co/t/break-down-log-messages-to-keywords/314588>\
**Category:** Logstash\
**Created:** [September 16, 2022, 3:39pm UTC](https://discuss.elastic.co/t/break-down-log-messages-to-keywords/314588 "2022-09-16T15:39:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_s/32/98686_2.png) [@Mark\_S](https://discuss.elastic.co/u/Mark_S)\
**Post date:** [September 16, 2022, 3:39pm UTC](https://discuss.elastic.co/t/break-down-log-messages-to-keywords/314588/1 "2022-09-16T15:39:40Z")

</div>

I want to index logs from different applications in one index.  
However some applications don't use exactly the same log format....

How can I use a grok pattern in the input section of the config file to break down the logfiles according to keywords that exist within the logfile?

I tried the grok constructor however, I could not find a way to make exceptions (e.g. if the logfile does not follow this pattern, then just keep the whole log as text)

---

<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 14, 2022, 3:39pm UTC](https://discuss.elastic.co/t/break-down-log-messages-to-keywords/314588/2 "2022-10-14T15:39:43Z")

</div>

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