# Special characters - replace

**URL:** <https://discuss.elastic.co/t/special-characters-replace/183156>\
**Category:** Logstash\
**Created:** [May 28, 2019, 5:30pm UTC](https://discuss.elastic.co/t/special-characters-replace/183156 "2019-05-28T17:30:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisca\_Lima](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@Francisca\_Lima](https://discuss.elastic.co/u/Francisca_Lima)\
**Post date:** [May 28, 2019, 5:30pm UTC](https://discuss.elastic.co/t/special-characters-replace/183156/1 "2019-05-28T17:30:21Z")

</div>

Hello,  
I have special characters in my fields like ã, á, à and others (in portuguese language we use them). There is a any to replace them? I tried to used ruby gsub like this "event.set('subProcessName', event.get('subProcessName').gsub(/ã/, 'a'))" to replace the character "ã" to "a". But some characters, when I copy to .conf file, they are shown like this " event.set('subProcessName', event.get('subProcessName').gsub(/▒| /, 'a'))".

Thank you,  
Francisca Vale Lima

---

<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:** [May 28, 2019, 10:04pm UTC](https://discuss.elastic.co/t/special-characters-replace/183156/2 "2019-05-28T22:04:46Z")

</div>

> [@Francisca\_Lima](#):
>
> I have special characters in my fields like ã, á, à and others

```
input { generator { count => 1 lines => ['I have special characters in my fields like ã, á, à and others'] } }
filter {
    ruby { code => 'event.set("message", I18n.transliterate(event.get("message")))' }
}

```

gets me

```
   "message" => "I have special characters in my fields like a, a, a and others",

```

---

<div class="post-metadata">

**Author:** ![Francisca\_Lima](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@Francisca\_Lima](https://discuss.elastic.co/u/Francisca_Lima)\
**Post date:** [May 30, 2019, 5:05pm UTC](https://discuss.elastic.co/t/special-characters-replace/183156/3 "2019-05-30T17:05:27Z")

</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:** [June 27, 2019, 5:05pm UTC](https://discuss.elastic.co/t/special-characters-replace/183156/4 "2019-06-27T17:05:27Z")

</div>

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