<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why does DBX prepend an escape character to double quotes when pulling JSON-formatted data from a table? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-DBX-prepend-an-escape-character-to-double-quotes-when/m-p/146122#M29766</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;DBX double quotes string data by default,  if this string content comes with “ in it, we replace them with \”.

In your case, the json string is with " in it, so they are all converted into \" as expected.

You may use the search language, perhaps as an eval expression, to remove the escape characters:

… | replace “\\""” with “\”” in message |…
… | eval message = replace(message, “\\””, “\”) | …

The advantage of eval statement is that it could be run via props/transforms.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 05 Dec 2014 21:54:34 GMT</pubDate>
    <dc:creator>btsay_splunk</dc:creator>
    <dc:date>2014-12-05T21:54:34Z</dc:date>
    <item>
      <title>Why does DBX prepend an escape character to double quotes when pulling JSON-formatted data from a table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-DBX-prepend-an-escape-character-to-double-quotes-when/m-p/146121#M29765</link>
      <description>&lt;P&gt;My table has a column with JSON-formatted data that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"Message" : {"Field1": 1000, "Field2": 1000, "Field3": 1000, "Field4": 500, "Field5": 200, "Field6": 500, "Field7": 300, "Field8": 500}} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But in Splunk, my raw event is coming in like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{\"Message\" : {\"Field1\": 1000, \"Field2\": 1000, \"Field3\": 1000, \"Field4\": 500, \"Field5\": 200, \"Field6\": 500, \"Field7\": 300, \"Field8\": 500}} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why is this happening and what can I do to correct it?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Dec 2014 20:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-DBX-prepend-an-escape-character-to-double-quotes-when/m-p/146121#M29765</guid>
      <dc:creator>lagnone_splunk</dc:creator>
      <dc:date>2014-12-05T20:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why does DBX prepend an escape character to double quotes when pulling JSON-formatted data from a table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-DBX-prepend-an-escape-character-to-double-quotes-when/m-p/146122#M29766</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;DBX double quotes string data by default,  if this string content comes with “ in it, we replace them with \”.

In your case, the json string is with " in it, so they are all converted into \" as expected.

You may use the search language, perhaps as an eval expression, to remove the escape characters:

… | replace “\\""” with “\”” in message |…
… | eval message = replace(message, “\\””, “\”) | …

The advantage of eval statement is that it could be run via props/transforms.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Dec 2014 21:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-DBX-prepend-an-escape-character-to-double-quotes-when/m-p/146122#M29766</guid>
      <dc:creator>btsay_splunk</dc:creator>
      <dc:date>2014-12-05T21:54:34Z</dc:date>
    </item>
  </channel>
</rss>

