# Hey i want to add some text into my message can anybody help me how to do it?

**URL:** <https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321>\
**Category:** Logstash\
**Created:** [January 6, 2021, 10:21am UTC](https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321 "2021-01-06T10:21:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jolaniya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jolaniya/32/81821_2.png) [@jolaniya](https://discuss.elastic.co/u/jolaniya)\
**Post date:** [January 6, 2021, 10:21am UTC](https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321/1 "2021-01-06T10:21:40Z")

</div>

Hey i want to add some text into my message can anybody help me how to do it?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 6, 2021, 4:52pm UTC](https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321/2 "2021-01-06T16:52:42Z")

</div>

Maybe using a [mutate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html) filter. You can add fields or tags, and the gsub option can modify fields.

---

<div class="post-metadata">

**Author:** ![jolaniya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jolaniya/32/81821_2.png) [@jolaniya](https://discuss.elastic.co/u/jolaniya)\
**Post date:** [January 7, 2021, 7:47am UTC](https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321/3 "2021-01-07T07:47:30Z")

</div>

> [@Badger](#):
>
> option

Hi Thankyou Badger for your reply.

I have used the update option but this replaced my whole message. I just want to put some additional text after the message. Can you please tell me in detail how to use gsub option for field modification? One more thing I wanna add I have xml data and I guess gsub supported only strings or arrays of strings.

---

<div class="post-metadata">

**Author:** ![Kurt\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kurt_s/32/17755_2.png) [@Kurt\_S](https://discuss.elastic.co/u/Kurt_S)\
**Post date:** [January 7, 2021, 2:30pm UTC](https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321/4 "2021-01-07T14:30:39Z")

</div>

Have you tried the replace function?

Something like this should work:

```
filter {
  mutate {
    replace => { "message" => "%{message} extra text" }
  }
}
```

---

<div class="post-metadata">

**Author:** ![jolaniya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jolaniya/32/81821_2.png) [@jolaniya](https://discuss.elastic.co/u/jolaniya)\
**Post date:** [January 13, 2021, 8:51am UTC](https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321/5 "2021-01-13T08:51:23Z")

</div>

hi **thanks for contributing!**

This works for me

---

<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:** [February 10, 2021, 8:51am UTC](https://discuss.elastic.co/t/hey-i-want-to-add-some-text-into-my-message-can-anybody-help-me-how-to-do-it/260321/6 "2021-02-10T08:51:26Z")

</div>

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