# Newbie assistance with grok

**URL:** <https://discuss.elastic.co/t/newbie-assistance-with-grok/78758>\
**Category:** Logstash\
**Created:** [March 15, 2017, 7:23pm UTC](https://discuss.elastic.co/t/newbie-assistance-with-grok/78758 "2017-03-15T19:23:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lexa](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@Lexa](https://discuss.elastic.co/u/Lexa)\
**Post date:** [March 15, 2017, 7:23pm UTC](https://discuss.elastic.co/t/newbie-assistance-with-grok/78758/1 "2017-03-15T19:23:44Z")

</div>

Hello,

I am new to logstash and struggling with custom grok.

I have a log file that has a series of bracket bound fields that I am trying to parse with kv. However, clearly I do not understand how to do this as, it is not processing my kv fields.

Here is my filter

filter {  
if [type] == "my-pixi-service" {  
grok {  
patterns\_dir =\> ["/etc/logstash/patterns"]  
match =\> ["message", "%{MPS}"]  
add\_tag =\> ["mps" , "grokked"]  
}  
kv {  
source =\> "keyvalues"  
field\_split =\> "]["  
remove\_field =\> ["keyvalues"]  
add\_tag =\> ["taggedy\_tag"]  
}  
}  
}

Here is my pattern  
MPS %{DATESTAMP:event\_time} %{LOGLEVEL:log\_level} %{GREEDYDATA:keyvalues}

The result is that is that I am getting the "keyvalues" field but, it is not executing the "kv" function. The keyvalues field is not being removed and the tag is not present.

I would greatly appreciate any assistance and guidance!

---

<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:** [March 15, 2017, 7:47pm UTC](https://discuss.elastic.co/t/newbie-assistance-with-grok/78758/2 "2017-03-15T19:47:03Z")

</div>

Please show an example log line.

---

<div class="post-metadata">

**Author:** ![Lexa](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@Lexa](https://discuss.elastic.co/u/Lexa)\
**Post date:** [March 16, 2017, 8:05pm UTC](https://discuss.elastic.co/t/newbie-assistance-with-grok/78758/3 "2017-03-16T20:05:51Z")

</div>

Hi,

Thank you for the reply. I was able to get assistance in the freenode channel.

Thank you!

---

<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:** [April 13, 2017, 8:06pm UTC](https://discuss.elastic.co/t/newbie-assistance-with-grok/78758/4 "2017-04-13T20:06:00Z")

</div>

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