# Performance grok vs mutate on finding message level

**URL:** https://discuss.elastic.co/t/performance-grok-vs-mutate-on-finding-message-level/29259
**Category:** Logstash
**Created:** [September 14, 2015, 3:22pm UTC](https://discuss.elastic.co/t/performance-grok-vs-mutate-on-finding-message-level/29259 "2015-09-14T15:22:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![michaellizhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaellizhou/32/4143_2.png) [@michaellizhou](https://discuss.elastic.co/u/michaellizhou)
#### Post date: [September 14, 2015, 3:22pm UTC](https://discuss.elastic.co/t/performance-grok-vs-mutate-on-finding-message-level/29259/1 "2015-09-14T15:22:24Z")

</div>

I have a log that is filled with nonsense data. So I am keeping it simple with a grok match only date than greedydata everything else. Halfway into the message I am given a message level i.e. info, error, ... that I need to track down.

So my question is what is better for performance grok and match each of these nonsense data that I do not know how to categorize

OR:

just use conditions and check if message contains error, info, debug

I ask because I have heard that grok takes a lot of resources but these conditionals may use just as much.

Thanks,  
M

---

<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 15, 2015, 9:56pm UTC](https://discuss.elastic.co/t/performance-grok-vs-mutate-on-finding-message-level/29259/2 "2015-09-15T21:56:41Z")

</div>

This is really something you'd want to test on your own data.

---

<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, 5:29am UTC](https://discuss.elastic.co/t/performance-grok-vs-mutate-on-finding-message-level/29259/3 "2017-07-06T05:29:03Z")

</div>


