# Remove special characters in a filed value

**URL:** <https://discuss.elastic.co/t/remove-special-characters-in-a-filed-value/107016>\
**Category:** Logstash\
**Created:** [November 9, 2017, 10:14am UTC](https://discuss.elastic.co/t/remove-special-characters-in-a-filed-value/107016 "2017-11-09T10:14:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 9, 2017, 10:14am UTC](https://discuss.elastic.co/t/remove-special-characters-in-a-filed-value/107016/1 "2017-11-09T10:14:05Z")

</div>

In my logstash filter, I received following filed and its value.. In order to remove duplicate filed value, first I need to remove special characters in that filed value.

For given sample the field name "log\_name" listed two results and they are duplicated values, but followed with special characters. " **Authentication,**" and " **Authentication;**"

So Need a help to remove special characters in the filed value (, and ; ) -\> comma and colon

```
"log_name" => [
    [0] "Authentication,",
    [1] "Authentication;"
],
```

---

<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:** [November 9, 2017, 11:01am UTC](https://discuss.elastic.co/t/remove-special-characters-in-a-filed-value/107016/2 "2017-11-09T11:01:10Z")

</div>

Use a mutate filter and its gsub option to replace commas and colons with an empty string.

---

<div class="post-metadata">

**Author:** ![srolskyi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srolskyi/32/24788_2.png) [@srolskyi](https://discuss.elastic.co/u/srolskyi)\
**Post date:** [November 28, 2017, 3:43pm UTC](https://discuss.elastic.co/t/remove-special-characters-in-a-filed-value/107016/3 "2017-11-28T15:43:55Z")

</div>

How you deleted duplicated data after removing special characters?

---

<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:** [December 26, 2017, 3:44pm UTC](https://discuss.elastic.co/t/remove-special-characters-in-a-filed-value/107016/4 "2017-12-26T15:44:31Z")

</div>

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