<?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 JOLT accessing a JSON value,NiFi expression language within JOLT in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JOLT-accessing-a-JSON-value-NiFi-expression-language/m-p/197415#M76363</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/73154/amarfloraubs.html" nodeid="73154" target="_blank"&gt;@John Smith&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Extract the b attribute value before using it in Jolt transform by using &lt;STRONG&gt;EvaluateJson path&lt;/STRONG&gt; processor and keep&lt;STRONG&gt; destination as flowfile-attibute&lt;/STRONG&gt;.Then add your b attribute as a new property in evaluatejson path processor once we add b attribute to the flowfile then your jolt transform will apply substring function on the b attribute.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EvaluateJsonPath configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64838-evaljson.png" style="width: 1847px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17842iE2171A4516411B86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64838-evaljson.png" alt="64838-evaljson.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;for testing i have added b attribute value as default in my jolt transform&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64836-jolt-attribute.png" style="width: 1410px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17843i359995EC1CB50BFA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64836-jolt-attribute.png" alt="64836-jolt-attribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Jolt spec testing:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64837-jolt-spec.png" style="width: 2897px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17844i79CB2CCA7C2B0712/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64837-jolt-spec.png" alt="64837-jolt-spec.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see at right below corner we are having output json content with c key having e as value.&lt;/P&gt;&lt;P&gt;Let us know if you are having issues/questions..!!&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 06:18:13 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T06:18:13Z</dc:date>
    <item>
      <title>Nifi JOLT accessing a JSON value,NiFi expression language within JOLT</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JOLT-accessing-a-JSON-value-NiFi-expression-language/m-p/197414#M76362</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;
I wish to apply a simple transformaton to a JSON using JOLT. I want to apply :substring(1,2) to the value of the key. I am using default jolt transformation  but I don't know how to access the value of JSON from within JOLT and then apply the transformation? &lt;/P&gt;&lt;P&gt;Please help. &lt;/P&gt;&lt;P&gt;JOLT :&lt;/P&gt;&lt;PRE&gt;[{
"operation": "default",
"spec": {
      "c":"${b:substring(1,2)}"
}
}] &lt;/PRE&gt;&lt;P&gt;JSON :&lt;/P&gt;&lt;PRE&gt;{
  "b":"hello"
}





&lt;/PRE&gt;&lt;P&gt;Result :&lt;/P&gt;&lt;PRE&gt;{
  "c":"",
  "b":"hello"
}&lt;/PRE&gt;&lt;P&gt;Expected result :&lt;/P&gt;&lt;PRE&gt;{
  "c":"e",
  "b":"hello"
}&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Mar 2018 13:02:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JOLT-accessing-a-JSON-value-NiFi-expression-language/m-p/197414#M76362</guid>
      <dc:creator>amarflora_ubs</dc:creator>
      <dc:date>2018-03-25T13:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi JOLT accessing a JSON value,NiFi expression language within JOLT</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JOLT-accessing-a-JSON-value-NiFi-expression-language/m-p/197415#M76363</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/73154/amarfloraubs.html" nodeid="73154" target="_blank"&gt;@John Smith&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Extract the b attribute value before using it in Jolt transform by using &lt;STRONG&gt;EvaluateJson path&lt;/STRONG&gt; processor and keep&lt;STRONG&gt; destination as flowfile-attibute&lt;/STRONG&gt;.Then add your b attribute as a new property in evaluatejson path processor once we add b attribute to the flowfile then your jolt transform will apply substring function on the b attribute.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EvaluateJsonPath configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64838-evaljson.png" style="width: 1847px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17842iE2171A4516411B86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64838-evaljson.png" alt="64838-evaljson.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;for testing i have added b attribute value as default in my jolt transform&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64836-jolt-attribute.png" style="width: 1410px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17843i359995EC1CB50BFA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64836-jolt-attribute.png" alt="64836-jolt-attribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Jolt spec testing:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64837-jolt-spec.png" style="width: 2897px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17844i79CB2CCA7C2B0712/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64837-jolt-spec.png" alt="64837-jolt-spec.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see at right below corner we are having output json content with c key having e as value.&lt;/P&gt;&lt;P&gt;Let us know if you are having issues/questions..!!&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:18:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JOLT-accessing-a-JSON-value-NiFi-expression-language/m-p/197415#M76363</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T06:18:13Z</dc:date>
    </item>
  </channel>
</rss>

