# Grok add field and add tag not working

**URL:** <https://discuss.elastic.co/t/grok-add-field-and-add-tag-not-working/93095>\
**Category:** Logstash\
**Created:** [July 14, 2017, 12:53am UTC](https://discuss.elastic.co/t/grok-add-field-and-add-tag-not-working/93095 "2017-07-14T00:53:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunvijayam](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@arunvijayam](https://discuss.elastic.co/u/arunvijayam)\
**Post date:** [July 14, 2017, 12:53am UTC](https://discuss.elastic.co/t/grok-add-field-and-add-tag-not-working/93095/1 "2017-07-14T00:53:49Z")

</div>

filter {  
mutate {  
add\_field =\> {  
"message" =\> "%{global\_stats},%{num\_rows}"  
}

# remove\_field =\> ["oldfield1", "oldfield"]

}

# grok {

# add\_tag =\> ["valid"]

# match =\> ["message" , "^YES,[123456789]+$"]

#}  
grok {

# add\_field =\> {

# "message" =\> "%{global\_stats},%{num\_rows}"

#}  
match =\> ["message" , "^YES,[123456789]+$" ]  
tag\_on\_failure =\> ["failed records"]  
add\_tag =\> ["parsed"]  
}  
#grok {

# match =\> ["num\_rows", "^[123456789]+$" ]

# tag\_on\_failure =\> ["failed records"]

#}  
}

---

<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:** [July 14, 2017, 6:55am UTC](https://discuss.elastic.co/t/grok-add-field-and-add-tag-not-working/93095/2 "2017-07-14T06:55:49Z")

</div>

Please format your configuration as preformatted text. There's a toolbar button for it.

Do you have more configuration than this? What does a line of input look like?

---

<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:** [August 11, 2017, 6:55am UTC](https://discuss.elastic.co/t/grok-add-field-and-add-tag-not-working/93095/3 "2017-08-11T06:55:54Z")

</div>

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