<?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>question Re: Removing Special Characters from JSON in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Removing-Special-Characters-from-JSON/m-p/169884#M45696</link>
    <description>&lt;P&gt;Hey Andrew,&lt;/P&gt;&lt;P&gt;If your message is a valid JSON (it seems to be), then a parser is able to read it an decode a literal string. The next trick is to put this results into a FlowFile content/body and run another EvaluateJsonPath/JoltTransformer chain. I did a quick experiment here, and it seems to work fine.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9254-screenshot-2.png" style="width: 1247px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20124iCF9B3C774BCF0F56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9254-screenshot-2.png" alt="9254-screenshot-2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9253-screenshot.png" style="width: 784px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20125iCC0CB8E8C261D7BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9253-screenshot.png" alt="9253-screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 10:48:06 GMT</pubDate>
    <dc:creator>andrewg</dc:creator>
    <dc:date>2019-08-18T10:48:06Z</dc:date>
    <item>
      <title>Removing Special Characters from JSON</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Removing-Special-Characters-from-JSON/m-p/169883#M45695</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a streaming use case where I'm ingesting JSON data via an MQ.  I am trying to pull out some key-value pairs from a JSON to be sent to a CEP for windowing functions. The issue is that the JSON file is storing the key-value pairs in a nested JSON map with special characters embedded in it. &lt;/P&gt;&lt;P&gt;
Below are the details regarding the steps I'm trying to take. Any suggestions on how to achieve my goal would be greatly appreciated. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current JSON:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;"Message": "[{\"Key\":\"Key1\",\"ResponseTime\":\"54\"},{\"Key\":\"Key2\",\"ResponseTime\":\"2186\"},{\"Key\":\"Key3\",\"ResponseTime\":\"2242\"}]",&lt;/PRE&gt;&lt;PRE&gt;{
	"IncludeExclude": true,
	"Description": "ResponseTimes",
	"TimeStamp": "2016-07-02T18:59:59.6162528-05:00",
	"Sequence": 0,
	"Loglevel": 0,
	"$type": "Information",
	"OperationName": "BeforeSendReply",
	"StateInfos": null,
	"FileName": "CSS.cs",
	"ClassName": null,
	"RequestUri": "https://ILoveHadoop.com",
	"AssemblyInfo": null,
	"LineNumber": "170",
	"TimeZone": null,
	"Message": "[{\"Key\":\"Key1\",\"ResponseTime\":\"54\"},{\"Key\":\"Key2\",\"ResponseTime\":\"2186\"},{\"Key\":\"Key3\",\"ResponseTime\":\"2242\"}]",
	"EventInfo": {
		"EventLevel": null,
		"$type": "Event123",
		"EventSuccess": null,
		"EventType": "Information"
	}
}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Trying to remove special characters so the JSON looks like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;"Message": [{"Key":"Key1","ResponseTime":"54"},{"Key":"Key2","ResponseTime":"2186"},{"Key":"Key3","ResponseTime":"2242"}],&lt;/PRE&gt;&lt;PRE&gt;{
	"IncludeExclude": true,
	"Description": "ResponseTimes",
	"TimeStamp": "2016-07-02T18:59:59.6162528-05:00",
	"Sequence": 0,
	"Loglevel": 0,
	"$type": "Information",
	"OperationName": "BeforeSendReply",
	"StateInfos": null,
	"FileName": "CSS.cs",
	"ClassName": null,
	"RequestUri": "https://ILoveHadoop.com",
	"AssemblyInfo": null,
	"LineNumber": "170",
	"TimeZone": null,
	"Message": [{"Key":"Key1","ResponseTime":"54"},{"Key":"Key2","ResponseTime":"2186"},{"Key":"Key3","ResponseTime":"2242"}],
	"EventInfo": {
		"EventLevel": null,
		"$type": "Event123",
		"EventSuccess": null,
		"EventType": "Information"
	}
}&lt;/PRE&gt;&lt;P&gt;Then I plan to run the below JOLT shift via the JOLT Processor in NiFi to transpose the map to a list:&lt;/P&gt;&lt;PRE&gt;\\Output for transposing message data
[
  {
    "operation": "shift",
    "spec": {
      "Message": {
        "*": {
          "@ResponseTime": "ApplicationResponseTimes.@Key"
        }
      }
    }
  }
]


&lt;/PRE&gt;&lt;P&gt;With an ultimate end output of:&lt;/P&gt;&lt;PRE&gt;{
  "ApplicationResponseTimes" : {
    "Key1" : "54",
    "Key3" : "2242",
    "Key2" : "2186"
  }
}
&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 12:27:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Removing-Special-Characters-from-JSON/m-p/169883#M45695</guid>
      <dc:creator>awatson</dc:creator>
      <dc:date>2026-04-21T12:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Special Characters from JSON</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Removing-Special-Characters-from-JSON/m-p/169884#M45696</link>
      <description>&lt;P&gt;Hey Andrew,&lt;/P&gt;&lt;P&gt;If your message is a valid JSON (it seems to be), then a parser is able to read it an decode a literal string. The next trick is to put this results into a FlowFile content/body and run another EvaluateJsonPath/JoltTransformer chain. I did a quick experiment here, and it seems to work fine.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9254-screenshot-2.png" style="width: 1247px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20124iCF9B3C774BCF0F56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9254-screenshot-2.png" alt="9254-screenshot-2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9253-screenshot.png" style="width: 784px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20125iCC0CB8E8C261D7BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9253-screenshot.png" alt="9253-screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 10:48:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Removing-Special-Characters-from-JSON/m-p/169884#M45696</guid>
      <dc:creator>andrewg</dc:creator>
      <dc:date>2019-08-18T10:48:06Z</dc:date>
    </item>
  </channel>
</rss>

