# Modify field content

**URL:** <https://discuss.elastic.co/t/modify-field-content/110274>\
**Category:** Logstash\
**Created:** [December 5, 2017, 7:50am UTC](https://discuss.elastic.co/t/modify-field-content/110274 "2017-12-05T07:50:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter\_Xue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/walter_xue/32/18475_2.png) [@Walter\_Xue](https://discuss.elastic.co/u/Walter_Xue)\
**Post date:** [December 5, 2017, 7:50am UTC](https://discuss.elastic.co/t/modify-field-content/110274/1 "2017-12-05T07:50:27Z")

</div>

I need to add new field at logstsh !  
the original field is request content "/example/example/example/getMessageList.json?\_t=1512453462541" , now I don't need "?\_t=1512453462541"  
so how to do it ?

config is:

mutate {  
add\_field =\> { "path" =\> "%{request}" }  
}  
mutate {  
split =\> { "path" =\> "?" }  
}

---

<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:** [December 5, 2017, 8:24am UTC](https://discuss.elastic.co/t/modify-field-content/110274/2 "2017-12-05T08:24:08Z")

</div>

I suggest a mutate filter with a gsub option. You can delete everything from the question mark until the end of the string.

---

<div class="post-metadata">

**Author:** ![Walter\_Xue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/walter_xue/32/18475_2.png) [@Walter\_Xue](https://discuss.elastic.co/u/Walter_Xue)\
**Post date:** [December 5, 2017, 1:51pm UTC](https://discuss.elastic.co/t/modify-field-content/110274/3 "2017-12-05T13:51:22Z")

</div>

Dear Sir:  
Your suggest already helped me !! my problem got the answer！！  
thank you so much !!

---

<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:** [January 2, 2018, 1:51pm UTC](https://discuss.elastic.co/t/modify-field-content/110274/4 "2018-01-02T13:51:25Z")

</div>

Closed on January 2, 2018, 1:51pm UTC

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