# Use filter mutate gsub emoticons (emoji) in unicode values

**URL:** <https://discuss.elastic.co/t/use-filter-mutate-gsub-emoticons-emoji-in-unicode-values/51194>\
**Category:** Logstash\
**Created:** [May 27, 2016, 7:18pm UTC](https://discuss.elastic.co/t/use-filter-mutate-gsub-emoticons-emoji-in-unicode-values/51194 "2016-05-27T19:18:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gautam\_S\_Thakur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gautam_s_thakur/32/5156_2.png) [@Gautam\_S\_Thakur](https://discuss.elastic.co/u/Gautam_S_Thakur)\
**Post date:** [May 27, 2016, 7:18pm UTC](https://discuss.elastic.co/t/use-filter-mutate-gsub-emoticons-emoji-in-unicode-values/51194/1 "2016-05-27T19:18:12Z")

</div>

I would like to use mutate (gsub) on "text" fieldname to replace unicode value of emoticons to respective string values. An example -

`"\ud83d\ude27" replaced by "emoticon_anguished"`

I tried to escape single backslash by two, as following. Replacement is not working.

```
filter {
        mutate {
                gsub => [
                                "text", "\\ud83d\\udc7f", " emoticon_imp ",
                                "text", "\\ud83d\\ude3e", " emoticon_pouting_cat "
                ]
        }
}

```

Any help? thank you.

---

<div class="post-metadata">

**Author:** ![Gautam\_S\_Thakur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gautam_s_thakur/32/5156_2.png) [@Gautam\_S\_Thakur](https://discuss.elastic.co/u/Gautam_S_Thakur)\
**Post date:** [May 27, 2016, 9:08pm UTC](https://discuss.elastic.co/t/use-filter-mutate-gsub-emoticons-emoji-in-unicode-values/51194/2 "2016-05-27T21:08:27Z")

</div>

I think, I am able to solve it. Instead of using emoji's unicode, we need to simply use emoji itself. like the following.

```
    mutate {
            gsub => [
                                    "text", "👿", " emoticon_imp ",
                                    "text", "😾", " emoticon_pouting_cat "
                           ]
                  }
```

---

<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:** [July 6, 2017, 4:55am UTC](https://discuss.elastic.co/t/use-filter-mutate-gsub-emoticons-emoji-in-unicode-values/51194/3 "2017-07-06T04:55:49Z")

</div>


