# Altering the content of a field

**URL:** <https://discuss.elastic.co/t/altering-the-content-of-a-field/93082>\
**Category:** Logstash\
**Created:** [July 13, 2017, 10:22pm UTC](https://discuss.elastic.co/t/altering-the-content-of-a-field/93082 "2017-07-13T22:22:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahsa\_b](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@mahsa\_b](https://discuss.elastic.co/u/mahsa_b)\
**Post date:** [July 13, 2017, 10:22pm UTC](https://discuss.elastic.co/t/altering-the-content-of-a-field/93082/1 "2017-07-13T22:22:48Z")

</div>

Hi ,  
I have a grok filter like this  
grok {  
patterns\_dir =\> "./patterns/custom-patterns"  
match =\> {"message" =\> ["%{IP:remoteIp}%{SPACE}%{MAC:remoteMac}%{SPACE}%{NUMBER}%{SPACE}%{WORD}%{SPACE}%{PORT:localPort}%{SPACE}vlan-id%{SPACE}%{NUMBER:vid}"]}  
add\_tag =\> ["neighbor\_node"]  
}

and it works fine. the thing is the field labeled as remoteMac is : seperated ex. 00:00:5e:00:01:a3  
now my question is, is there a way to remove : and save the result again in remoteMac field?

Thanks

---

<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 13, 2017, 10:33pm UTC](https://discuss.elastic.co/t/altering-the-content-of-a-field/93082/2 "2017-07-13T22:33:18Z")

</div>

Use a mutate filter and its gsub option to remove the colons from the field contents.

---

<div class="post-metadata">

**Author:** ![mahsa\_b](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@mahsa\_b](https://discuss.elastic.co/u/mahsa_b)\
**Post date:** [July 14, 2017, 8:24pm UTC](https://discuss.elastic.co/t/altering-the-content-of-a-field/93082/3 "2017-07-14T20:24:09Z")

</div>

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:** [August 11, 2017, 8:24pm UTC](https://discuss.elastic.co/t/altering-the-content-of-a-field/93082/4 "2017-08-11T20:24:27Z")

</div>

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