# Custom grok filter

**URL:** <https://discuss.elastic.co/t/custom-grok-filter/281105>\
**Category:** Logstash\
**Created:** [August 11, 2021, 6:05pm UTC](https://discuss.elastic.co/t/custom-grok-filter/281105 "2021-08-11T18:05:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gba8912](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gba8912](https://discuss.elastic.co/u/gba8912)\
**Post date:** [August 11, 2021, 6:05pm UTC](https://discuss.elastic.co/t/custom-grok-filter/281105/1 "2021-08-11T18:05:46Z")

</div>

Hello, I'm new to all this so bear with me. My company has asked me to figure out elk stack and how to make it work for their logs. I have everything set up and working but I need to be able to parse the logs in kibana a certain way. I am guessing that I would use grok filter in logstash.conf for that right?  
I need to filter and see the message like so:  
node:  
domain:  
group:  
profile:  
timeofreceipt:  
unknown:  
format:  
unknown:  
timein:  
timeenq:  
timedeq:  
timesent:  
cat:

Does anyone know how I can do that or where I can learn how to?

Thanks

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [August 11, 2021, 6:13pm UTC](https://discuss.elastic.co/t/custom-grok-filter/281105/2 "2021-08-11T18:13:18Z")

</div>

Do you have an example of one of your log files?

---

<div class="post-metadata">

**Author:** ![gba8912](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gba8912](https://discuss.elastic.co/u/gba8912)\
**Post date:** [August 11, 2021, 7:19pm UTC](https://discuss.elastic.co/t/custom-grok-filter/281105/3 "2021-08-11T19:19:18Z")

</div>

Hi Aqua,

They said I cant post all of the message example due to being proprietary but this is how it looks: node.domain.group.profile.timeofreceipt.unknown.format.unknown.timein.timeenq.timedeq.timesent.cat

I replaced the each part of the message with what category it is.

Here is part of the message i can post though: This what each time number means,  
timein: 2021:07:27:15:48:16:579463060  
timeenq: 2021:07:27:15:48:46:588113175  
timedeq: 2021:07:27:15:48:16:588134625  
timesent: 2021:07:27:15:48:16:5881858865

And this is the actual message for what the times look like: 2021:07:27:15:48:16:579463060,2021:07:27:15:48:46:588113175,2021:07:27:15:48:16:588134625,2021:07:27:15:48:16:5881858865

So basically, I need to be able to somehow parse the message in kibana so they can see each category. I hope this makes some sense to you. Im only 2 days into elk stack in general so just figuring out the basics atm.

---

<div class="post-metadata">

**Author:** ![gba8912](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gba8912](https://discuss.elastic.co/u/gba8912)\
**Post date:** [August 23, 2021, 3:59pm UTC](https://discuss.elastic.co/t/custom-grok-filter/281105/4 "2021-08-23T15:59:51Z")

</div>

Our Splunk lady helped me figure it out so I am posting the answer in case anyone else ends up needing to do this.  
For grok filter I added this:  
grok {  
match =\> { "message" =\> "(?\w+).(?\w+).(?\w+).(?\w+)|(?\d+.\d+)|(?\d+)|(?\S+)|(?\d+),(?\S+),(?\S+),(?\S+),(?\S+),(?\d)" }  
}  
}

Now in Kibana, I can see the fields I need and the message is parsing correctly.

---

<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:** [September 20, 2021, 4:00pm UTC](https://discuss.elastic.co/t/custom-grok-filter/281105/5 "2021-09-20T16:00:08Z")

</div>

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