<?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: Jolt transform use keys as value in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Jolt-transform-use-keys-as-value/m-p/361133#M238518</link>
    <description>&lt;P&gt;Idk if it is much of a help, but you can try checking the &lt;A title="jolt-quick-reference" href="https://community.cloudera.com/t5/Community-Articles/Jolt-quick-reference-for-Nifi-Jolt-Processors/ta-p/244350" target="_self"&gt;Jolt Transform quick reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There's this &lt;A title="jolt-test" href="https://jolt-demo.appspot.com/#inception" target="_self"&gt;link&lt;/A&gt;&amp;nbsp;to test JOLT specifications.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You can try starting with something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[{
  "operation": "shift",
  "spec": {
    "*": "&amp;amp;"
  }
}, {
  "operation": "default",
  "spec": {
    "*": {
      "id": "&amp;amp;(1,0)"
    }
  }
}]&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 12 Jan 2023 11:44:51 GMT</pubDate>
    <dc:creator>linssab</dc:creator>
    <dc:date>2023-01-12T11:44:51Z</dc:date>
    <item>
      <title>Jolt transform use keys as value</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Jolt-transform-use-keys-as-value/m-p/361058#M238499</link>
      <description>&lt;P&gt;Hello, I cannot find an answer on the www to my following question. I have tried splitjson and jolttransform to achieve my desired outcome, but nothing does the trick. My input file looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;{&lt;BR /&gt;"BVjsoBHDSI" : {&lt;BR /&gt;"date" : "2021-04-08",&lt;BR /&gt;"description" : "blabla1",&lt;BR /&gt;"number" : 40&lt;BR /&gt;},&lt;BR /&gt;"FudNSk" : {&lt;BR /&gt;"date" : "2021-09-26",&lt;BR /&gt;"description" : "blabla2",&lt;BR /&gt;"number" : 80&lt;BR /&gt;},&lt;BR /&gt;"Cfjdsl54fd" : {&lt;BR /&gt;"date" : "2022-05-10",&lt;BR /&gt;"description" : "blablubb",&lt;BR /&gt;"number" : 31&lt;BR /&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually I just want to split the stupid thing, but since the root level has a different individual value nifi doesn't understand what I want to do. The idea was to use a jolt transform to add a key "id" with the original key as value. I can't figure out a proper specification though. Glad to hear your ideas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;{&lt;BR /&gt;"BVjsoBHDSI" : {&lt;BR /&gt;"date" : "2021-04-08",&lt;BR /&gt;"description" : "blabla1",&lt;BR /&gt;"number" : 40,&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;"id" : "BVjsoBHDSI"&lt;BR /&gt;},&lt;BR /&gt;"FudNSk" : {&lt;BR /&gt;"date" : "2021-09-26",&lt;BR /&gt;"description" : "blabla2",&lt;BR /&gt;"number" : 80,&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;"id" : "FudNSk"&lt;BR /&gt;},&lt;BR /&gt;"Cfjdsl54fd" : {&lt;BR /&gt;"date" : "2022-05-10",&lt;BR /&gt;"description" : "blablubb",&lt;BR /&gt;"number" : 31,&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;"id" : "Cfjdsl54fd"&lt;BR /&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I could easily overwrite the root and split the flowfile as usual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 15:58:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Jolt-transform-use-keys-as-value/m-p/361058#M238499</guid>
      <dc:creator>Fredi</dc:creator>
      <dc:date>2023-01-11T15:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Jolt transform use keys as value</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Jolt-transform-use-keys-as-value/m-p/361133#M238518</link>
      <description>&lt;P&gt;Idk if it is much of a help, but you can try checking the &lt;A title="jolt-quick-reference" href="https://community.cloudera.com/t5/Community-Articles/Jolt-quick-reference-for-Nifi-Jolt-Processors/ta-p/244350" target="_self"&gt;Jolt Transform quick reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There's this &lt;A title="jolt-test" href="https://jolt-demo.appspot.com/#inception" target="_self"&gt;link&lt;/A&gt;&amp;nbsp;to test JOLT specifications.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You can try starting with something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[{
  "operation": "shift",
  "spec": {
    "*": "&amp;amp;"
  }
}, {
  "operation": "default",
  "spec": {
    "*": {
      "id": "&amp;amp;(1,0)"
    }
  }
}]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 Jan 2023 11:44:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Jolt-transform-use-keys-as-value/m-p/361133#M238518</guid>
      <dc:creator>linssab</dc:creator>
      <dc:date>2023-01-12T11:44:51Z</dc:date>
    </item>
  </channel>
</rss>

