# \_grokparsefailure tag - fails to do a thing

**URL:** <https://discuss.elastic.co/t/-grokparsefailure-tag-fails-to-do-a-thing/76005>\
**Category:** Logstash\
**Created:** [February 22, 2017, 9:11am UTC](https://discuss.elastic.co/t/-grokparsefailure-tag-fails-to-do-a-thing/76005 "2017-02-22T09:11:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yami](https://avatars.discourse-cdn.com/v4/letter/y/439d5e/32.png) [@yami](https://discuss.elastic.co/u/yami)\
**Post date:** [February 22, 2017, 9:11am UTC](https://discuss.elastic.co/t/-grokparsefailure-tag-fails-to-do-a-thing/76005/1 "2017-02-22T09:11:25Z")

</div>

i tried to make grok pattern:

PODPISY (?:[\s\S]\*?\</podpisy\>)

it's based on REGEX:  
[http://regexr.com/3fbti](http://regexr.com/3fbti)

and it works as it should.

I use it in config like that:

filter{  
grok { match =\> { "message" =\> "%{PODPISY}" }}  
}

A log appeared that head inside message something like:  
aaaaaaaaaaaaaaaaaaaazazafrthjrfjr3523

but still i got \_grokparsefailure tag and i don't have any additional field.

Finally i want delete this part of text from message.

---

<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:** [February 22, 2017, 9:17am UTC](https://discuss.elastic.co/t/-grokparsefailure-tag-fails-to-do-a-thing/76005/2 "2017-02-22T09:17:06Z")

</div>

> Finally i want delete this part of text from message.

Sounds like the mutate filter's gsub option might be a better match than grok.

---

<div class="post-metadata">

**Author:** ![yami](https://avatars.discourse-cdn.com/v4/letter/y/439d5e/32.png) [@yami](https://discuss.elastic.co/u/yami)\
**Post date:** [February 22, 2017, 9:20am UTC](https://discuss.elastic.co/t/-grokparsefailure-tag-fails-to-do-a-thing/76005/3 "2017-02-22T09:20:27Z")

</div>

> [@magnusbaeck](#):
>
> Sounds like the mutate filter's gsub option might be a better match than grok.

I will check that:

```
 gsub => [
            "message", "<podpisy>[\\s\\S]*?<\\/podpisy>", "podpis"
         ]

```

this does not seem to work. I tried to escape / in my regex.  
As mentioned here: [mutate | Logstash Reference [1.5] | Elastic](https://www.elastic.co/guide/en/logstash/1.5/plugins-filters-mutate.html#plugins-filters-mutate-gsub)  
It works without escaping.

Can you tell me why i get \_grokparsefailure tag and i don't have any additional field ?  
Is something wrong with my config / grok ?

Also this part of xml is only part of the field. I don't want to cut everything. I want to cut part of it and leave the rest.

I use Logstash 1.4.2  
Kibana 3  
ES 1.4.0

---

<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:** [March 22, 2017, 9:21am UTC](https://discuss.elastic.co/t/-grokparsefailure-tag-fails-to-do-a-thing/76005/4 "2017-03-22T09:21:08Z")

</div>

Closed on March 22, 2017, 9:21am UTC

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