# Overwrite the value for String field

**URL:** <https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813>\
**Category:** Logstash\
**Created:** [October 11, 2023, 11:34am UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813 "2023-10-11T11:34:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)\
**Post date:** [October 11, 2023, 11:34am UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813/1 "2023-10-11T11:34:06Z")

</div>

Good day ! could you please help me with the following question:  
how can i overwrite or (what plugin should i use?) the following value to another one:

from **/server/oauth2/userinfo/slaves/** \*  
to **/server/oauth2/userinfo**  
for nginx.access.uripath field

logstash version is 7.6.1

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [October 11, 2023, 11:43am UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813/2 "2023-10-11T11:43:48Z")

</div>

[Mutate update](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-update) to update value or rename to change the field name.

---

<div class="post-metadata">

**Author:** ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)\
**Post date:** [October 11, 2023, 11:47am UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813/3 "2023-10-11T11:47:59Z")

</div>

i tried to use this, but i need to change some values to another values regularly (drop extra information from uri)

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [October 11, 2023, 12:11pm UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813/4 "2023-10-11T12:11:30Z")

</div>

Something like this:  
`mutate { gsub => ["[nginx][access][uripath]","\/server\/oauth2\/userinfo\/slaves\/*", "/server/oauth2/userinfo" ] }`  
Is this part in url? For instance, /server/oauth2/userinfo/slaves/images/pic.jpg?

---

<div class="post-metadata">

**Author:** ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)\
**Post date:** [October 11, 2023, 1:14pm UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813/5 "2023-10-11T13:14:09Z")

</div>

yes, it is

---

<div class="post-metadata">

**Author:** ![My\_Google\_Account](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/my_google_account/32/55185_2.png) [@My\_Google\_Account](https://discuss.elastic.co/u/My_Google_Account)\
**Post date:** [October 11, 2023, 1:43pm UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813/6 "2023-10-11T13:43:05Z")

</div>

Unfortunately, uri path didn't modified

---

<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:** [November 8, 2023, 1:43pm UTC](https://discuss.elastic.co/t/overwrite-the-value-for-string-field/344813/7 "2023-11-08T13:43:43Z")

</div>

Closed on November 8, 2023, 1:43pm UTC

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