<?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: Unable to extract a special character nested dictionary dynamic  key in json in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/328847#M230353</link>
    <description>&lt;P&gt;this solution is already tried and it works like all matches. but i dont want to use data[*]. As my request is to parse a dict key which is dynamic and needs to be validated for a right string along with fetching the its values.. meaning the content inside data.['ABC_xyz'] which is a string how can we set it.. I dont understand how to pass a var ${} as string in data.[] bcoz key name also has some special chars&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Oct 2021 11:58:07 GMT</pubDate>
    <dc:creator>Apoo</dc:creator>
    <dc:date>2021-10-26T11:58:07Z</dc:date>
    <item>
      <title>Unable to extract a special character nested dictionary dynamic  key in json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/324294#M229330</link>
      <description>&lt;P&gt;hi i have a following json nested dictionary:&lt;/P&gt;&lt;P&gt;{"data" :{&lt;BR /&gt;"Abc_def_{x_y.z.test_at_here}.json":{&lt;BR /&gt;"timestamp_start": 0,&lt;/P&gt;&lt;P&gt;"timestamp_stop": 0&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}}&lt;/P&gt;&lt;P&gt;i need to extract the value of 3rd level json key that is from timestamps :&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"timestamp_start": 0,&lt;/P&gt;&lt;P&gt;"timestamp_stop": 0&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I tried using evauatejsonpath with $.data.['Abc_def_{x_y.z.test_at_here}.json']. it worked fine.&lt;/P&gt;&lt;P&gt;But i have the content inside curly {x_y.z.test_at_here} in .json key which is dynamic with special characters.&lt;/P&gt;&lt;P&gt;Also tried parsing usin updateattribute, but i am unable pass it as a string in eval&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 06:53:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/324294#M229330</guid>
      <dc:creator>Apoo</dc:creator>
      <dc:date>2021-09-14T06:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to extract a special character nested dictionary dynamic  key in json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/326181#M229803</link>
      <description>&lt;P&gt;can someone assist for the same&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 06:46:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/326181#M229803</guid>
      <dc:creator>Apoo</dc:creator>
      <dc:date>2021-10-04T06:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to extract a special character nested dictionary dynamic  key in json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/328256#M230228</link>
      <description>&lt;P&gt;Sorry for the late reply. I'm not an expert but have you looked at this solved thread?&amp;nbsp;&lt;A id="link_2_4b29ce58c33ad9_0_44bf0" class="page-link lia-link-navigation lia-custom-event" href="https://community.cloudera.com/t5/Support-Questions/Extract-string-nested-in-JSON-value/td-p/305099/jump-to/first-unread-message" target="_blank"&gt;Extract string nested in JSON value&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 13:50:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/328256#M230228</guid>
      <dc:creator>cjervis</dc:creator>
      <dc:date>2021-10-20T13:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to extract a special character nested dictionary dynamic  key in json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/328297#M230234</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/91900"&gt;@Apoo&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Not sure if this is the best solution, but you could use a combination of EvaluateJsonPath and ReplaceText to convert you sample source in to you sample output.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;EvaluateJsonPath processor:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1634752112935.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/32701iD84CEA108948FC60/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MattWho_0-1634752112935.png" alt="MattWho_0-1634752112935.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;'new"dynamic property (can use any property name) =&amp;nbsp;&lt;STRONG&gt;$.data[*]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;this would result in this output based on your example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[{"timestamp_start":0,"timestamp_stop":0}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So we can then use the replaceText to trim off the leading "[" and trailing "]":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_1-1634752238821.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/32702iC66449642484F210/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MattWho_1-1634752238821.png" alt="MattWho_1-1634752238821.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Search Value =&amp;nbsp;(^\[)|(\]$)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then you have you desired output of:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"timestamp_start":0,"timestamp_stop":0}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you found this response assisted with your query, please take a moment to login and click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below this post.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 17:53:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/328297#M230234</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-10-20T17:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to extract a special character nested dictionary dynamic  key in json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/328847#M230353</link>
      <description>&lt;P&gt;this solution is already tried and it works like all matches. but i dont want to use data[*]. As my request is to parse a dict key which is dynamic and needs to be validated for a right string along with fetching the its values.. meaning the content inside data.['ABC_xyz'] which is a string how can we set it.. I dont understand how to pass a var ${} as string in data.[] bcoz key name also has some special chars&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 11:58:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/328847#M230353</guid>
      <dc:creator>Apoo</dc:creator>
      <dc:date>2021-10-26T11:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to extract a special character nested dictionary dynamic  key in json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/329005#M230375</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/91900"&gt;@Apoo&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The EvaluateJsonPath processor dynamic properties do not support NiFi Expression language, so being able to pass dynamic strings to these dynamic properties from FlowFile attributes is not possible.&amp;nbsp; &amp;nbsp;The dynamic properties only support NiFi parameters.&lt;BR /&gt;&lt;BR /&gt;You may want to raise an Apache NiFi jira requesting adding NiFi EL support to these dynamic properties or even contribute the the open source code if you so choose.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 21:20:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Unable-to-extract-a-special-character-nested-dictionary/m-p/329005#M230375</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-10-27T21:20:30Z</dc:date>
    </item>
  </channel>
</rss>

