<?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: NiFi Replace Text: how t0 replace string &amp;quot; [{&amp;quot; with &amp;quot;{” in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/221536#M63209</link>
    <description>&lt;P&gt;The following configuration of ReplaceText should work for you:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="16496-replacetext-1-element-array.png" style="width: 870px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15775i2C37EEDC4749FE9C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="16496-replacetext-1-element-array.png" alt="16496-replacetext-1-element-array.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;where the Search Value is the following:&lt;/P&gt;&lt;PRE&gt;[\[\]](\{|\})&lt;/PRE&gt;&lt;P&gt;This matches [{ or ]} (and also [} and ]{ which shouldn't show up if your input is valid JSON) and replaces it with whichever curly brace it found. Note that this is a fairly specific solution, where the array is the last element of an object (i.e. the end pattern is not the end-of-object followed by end-of-array, rather the reverse).&lt;/P&gt;&lt;P&gt;A more forgiving solution (for your input JSON) might be to use the following Chain spec in a &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache.nifi.processors.standard.JoltTransformJSON/index.html" rel="nofollow noopener noreferrer"&gt;JoltTransformJSON&lt;/A&gt; processor:&lt;/P&gt;&lt;PRE&gt;[
  {
    "operation": "shift",
    "spec": {
      "result": {
        "curves": {
          "*": {
            "@": "result.curves"
          }
        },
        "*": "result.&amp;amp;"
      },
      "*": "&amp;amp;"
    }
  }
]&lt;/PRE&gt;&lt;P&gt;This "hoists" the object in the 1-element array up one level, achieving the same result as the ReplaceText pattern above.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 02:15:29 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2019-08-18T02:15:29Z</dc:date>
    <item>
      <title>NiFi Replace Text: how t0 replace string " [{" with "{”</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/221535#M63208</link>
      <description>&lt;P&gt;i have the following son structure and want to replace the special character string "[{" and "]}" with "{" and "}" :&lt;/P&gt;&lt;P&gt;{"result": {"step": 1800, "start_time": 1491174000, "end_time": 1491260400, "curves": [{"color": "#a05830", "rrddata": [0.603695, 1.06903, 0.94504, 0.68786, 31.3228, 0.316447, 0.808407, 0.247655, 0.174552, 0.123072, 0.62, 0.0689, 0.30758, 0.0869783, 0.14478, 0.305993, 0.808873, 0.193055, 0.113133, 0.46116, 8.047, 1.88388, 2.62721, 0.770247, 8.06144, 2.25591, 22.3061, 57.5539, 0.270233, 1.50602, 0.819887, 5.90425, 0.43361, 0.526907, 2.46678, 0.759873, 0.451133, 0.25843, 0.224033, 0.661373, 1.1279, 0.348587, 0.277142, 0.06647, 0.16693, 0.06225, 0.0588483, 0.08057], "line_type": "area", "title": "Disk utilization"}]}, "result_code": 0}&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 20:57:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/221535#M63208</guid>
      <dc:creator>timo_burmeister</dc:creator>
      <dc:date>2017-06-19T20:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Replace Text: how t0 replace string " [{" with "{”</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/221536#M63209</link>
      <description>&lt;P&gt;The following configuration of ReplaceText should work for you:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="16496-replacetext-1-element-array.png" style="width: 870px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15775i2C37EEDC4749FE9C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="16496-replacetext-1-element-array.png" alt="16496-replacetext-1-element-array.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;where the Search Value is the following:&lt;/P&gt;&lt;PRE&gt;[\[\]](\{|\})&lt;/PRE&gt;&lt;P&gt;This matches [{ or ]} (and also [} and ]{ which shouldn't show up if your input is valid JSON) and replaces it with whichever curly brace it found. Note that this is a fairly specific solution, where the array is the last element of an object (i.e. the end pattern is not the end-of-object followed by end-of-array, rather the reverse).&lt;/P&gt;&lt;P&gt;A more forgiving solution (for your input JSON) might be to use the following Chain spec in a &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache.nifi.processors.standard.JoltTransformJSON/index.html" rel="nofollow noopener noreferrer"&gt;JoltTransformJSON&lt;/A&gt; processor:&lt;/P&gt;&lt;PRE&gt;[
  {
    "operation": "shift",
    "spec": {
      "result": {
        "curves": {
          "*": {
            "@": "result.curves"
          }
        },
        "*": "result.&amp;amp;"
      },
      "*": "&amp;amp;"
    }
  }
]&lt;/PRE&gt;&lt;P&gt;This "hoists" the object in the 1-element array up one level, achieving the same result as the ReplaceText pattern above.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 02:15:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/221536#M63209</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2019-08-18T02:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Replace Text: how t0 replace string " [{" with "{”</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/221537#M63210</link>
      <description>&lt;P&gt;Thanks Matt!&lt;/P&gt;&lt;P&gt;Works perfekt ...&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 19:24:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/221537#M63210</guid>
      <dc:creator>timo_burmeister</dc:creator>
      <dc:date>2017-06-20T19:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Replace Text: how t0 replace string " [{" with "{”</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/312333#M63211</link>
      <description>&lt;P&gt;How to perform the same for the very first occurrence of [ and last occurrence of ].&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 16:55:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-Text-how-t0-replace-string-quot-quot-with-quot/m-p/312333#M63211</guid>
      <dc:creator>Althotta</dc:creator>
      <dc:date>2021-03-02T16:55:44Z</dc:date>
    </item>
  </channel>
</rss>

