# How to remove spacial character \\ added by logstash?

**URL:** <https://discuss.elastic.co/t/how-to-remove-spacial-character-added-by-logstash/98743>\
**Category:** Logstash\
**Created:** [August 29, 2017, 6:30pm UTC](https://discuss.elastic.co/t/how-to-remove-spacial-character-added-by-logstash/98743 "2017-08-29T18:30:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)\
**Post date:** [August 29, 2017, 6:30pm UTC](https://discuss.elastic.co/t/how-to-remove-spacial-character-added-by-logstash/98743/1 "2017-08-29T18:30:24Z")

</div>

Hi,

I have a field which contains several double quotes. Problem here is, Logstash is adding \ where ever there is double quote. How to remove that special character? I tried mutate with gsub but it's not working. Please see the sample log below,

`"query" => "SELECT 1 AS \"Number_of_Records\", \"agg\".\"category\" AS \"category\", \"agg\".\"clientid\"`

---

<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:** [August 30, 2017, 5:17am UTC](https://discuss.elastic.co/t/how-to-remove-spacial-character-added-by-logstash/98743/2 "2017-08-30T05:17:21Z")

</div>

You don't actually have backslashes in the string.

> **[Escape character | Programming and data formats](https://en.wikipedia.org/wiki/Escape_character#Programming_and_data_formats)**
>
> Many modern programming languages specify the doublequote character (") as a delimiter for a string literal. The backslash (\\) escape character typically provides two ways to include doublequotes inside a string literal, either by modifying the meaning of the doublequote character embedded in the string (\\" becomes "), or by modifying the meaning of a sequence of characters including the hexadecimal value of a doublequote character (\\x22 becomes "). C, C++, Java, and Ruby all allow exactly the sa...

---

<div class="post-metadata">

**Author:** ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)\
**Post date:** [August 30, 2017, 7:26pm UTC](https://discuss.elastic.co/t/how-to-remove-spacial-character-added-by-logstash/98743/3 "2017-08-30T19:26:32Z")

</div>

Just noticed that, thanks Magnus 🙂

---

<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:** [September 27, 2017, 7:26pm UTC](https://discuss.elastic.co/t/how-to-remove-spacial-character-added-by-logstash/98743/4 "2017-09-27T19:26:58Z")

</div>

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