<?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: JoltTransformJSON - Extract attribute witouth remove it in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242592#M204393</link>
    <description>&lt;P&gt;thanks!! it's works&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2019 12:59:18 GMT</pubDate>
    <dc:creator>calonsca</dc:creator>
    <dc:date>2019-06-18T12:59:18Z</dc:date>
    <item>
      <title>JoltTransformJSON - Extract attribute witouth remove it</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242589#M204390</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;first at all, i am kind of newbie with nifi so feel free to change everywhting you see.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am ussing JoltTransformJSON. My input JSON is the next one:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;{&lt;!-- --&gt;&lt;/P&gt;&lt;P&gt;"ID": "123",&lt;/P&gt;&lt;P&gt;"Text1": "aaa",&lt;/P&gt;&lt;P&gt;"Text2": "aaa",&lt;/P&gt;&lt;P&gt;"Text3": "aaa"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;And i need the next output:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;{&lt;!-- --&gt;&lt;/P&gt;&lt;P&gt;"data": {&lt;!-- --&gt;&lt;/P&gt;&lt;P&gt;"ID": "123",&lt;/P&gt;&lt;P&gt;"Text1": "aaa",&lt;/P&gt;&lt;P&gt;"Text2": "aaa",&lt;/P&gt;&lt;P&gt;"Text3": "aaa"&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;"date": "",&lt;/P&gt;&lt;P&gt;"dataset": "",&lt;/P&gt;&lt;P&gt;"ID": "123"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The var date and dataset are attributes from the flow, so there is no problem here, the problem is i need to extract the value of ID, in this case 123 but this is just an example, &lt;STRONG&gt;without deleted the ID inside de field data&lt;/STRONG&gt;. My Jolt Specification is the next one:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;[{&lt;!-- --&gt;&lt;/P&gt;&lt;P&gt;"operation": "shift",&lt;/P&gt;&lt;P&gt;"spec": {&lt;!-- --&gt;&lt;/P&gt;&lt;P&gt;"*": "data.&amp;amp;"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}, {&lt;!-- --&gt;&lt;/P&gt;&lt;P&gt;"operation": "default",&lt;/P&gt;&lt;P&gt;"spec": {&lt;!-- --&gt;&lt;/P&gt;&lt;P&gt;"dataset": "${dataset:toLower()}",&lt;/P&gt;&lt;P&gt;"date": "${date}"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;and with that i have all EXCEPT the ID field, that i dont know how to do it :(.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thankss&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:23:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242589#M204390</guid>
      <dc:creator>calonsca</dc:creator>
      <dc:date>2019-06-17T18:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: JoltTransformJSON - Extract attribute witouth remove it</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242590#M204391</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/114667/carlosalonsocapilla.html" nodeid="114667"&gt;@Carlos&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try with below spec:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[{
  "operation": "shift",
  "spec": {
    "*": "data.&amp;amp;",
    "ID": ["ID", "data.ID"]
  }
}, {
  "operation": "default",
  "spec": {
    "dataset": "${dataset:toLower()}",
    "date": "${date}"
  }
}]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{
  "ID" : "123",
  "data" : {
    "ID" : "123",
    "Text1" : "aaa",
    "Text2" : "aaa",
    "Text3" : "aaa"
  },
  "date" : "${date}",
  "dataset" : "${dataset:toLower()}"
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jun 2019 07:58:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242590#M204391</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-06-18T07:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: JoltTransformJSON - Extract attribute witouth remove it</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242591#M204392</link>
      <description>&lt;P&gt;The above was originally posted in the &lt;A href="https://community.hortonworks.com/spaces/101/index.html"&gt;Community Help Track&lt;/A&gt;. On Tue Jun 18 03:07 UTC 2019, a member of the HCC moderation staff moved it to the &lt;A href="https://community.hortonworks.com/spaces/63/data-flow-track.html"&gt;Data Ingestion &amp;amp; Streaming &lt;/A&gt; track. The &lt;EM&gt;Community Help Track&lt;/EM&gt; is intended for questions about using the HCC site itself.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 10:09:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242591#M204392</guid>
      <dc:creator>ask_bill_brooks</dc:creator>
      <dc:date>2019-06-18T10:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: JoltTransformJSON - Extract attribute witouth remove it</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242592#M204393</link>
      <description>&lt;P&gt;thanks!! it's works&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 12:59:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/242592#M204393</guid>
      <dc:creator>calonsca</dc:creator>
      <dc:date>2019-06-18T12:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: JoltTransformJSON - Extract attribute witouth remove it</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/303775#M221706</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/51824"&gt;@calonsca&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;Please have a look at this spec as well!&lt;/P&gt;&lt;PRE&gt;[&lt;BR /&gt; {&lt;BR /&gt;  "operation": "shift",&lt;BR /&gt;  "spec": {&lt;BR /&gt;   "@": "data",&lt;BR /&gt;   "ID": "&amp;amp;",&lt;BR /&gt;   "#${date}": "date",&lt;BR /&gt;   "#${dataset:toLower()}": "dataset"&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt;]&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 19:47:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JoltTransformJSON-Extract-attribute-witouth-remove-it/m-p/303775#M221706</guid>
      <dc:creator>PVVK</dc:creator>
      <dc:date>2020-09-30T19:47:02Z</dc:date>
    </item>
  </channel>
</rss>

