<?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 - Need help with JOLT-Syntax JoltTransformJSON in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Need-help-with-JOLT-Syntax-JoltTransformJSON/m-p/241061#M202865</link>
    <description>&lt;P&gt;You were so close! By using the [] syntax it just adds to the outgoing array, but you wanted to associate them with the same index, namely the one matched by the * "above" the fields. Put #2 inside your braces (#2 is a reference to the array index you're iterating over, "two levels up" from where you are in the spec):&lt;/P&gt;&lt;PRE&gt;[{
&amp;nbsp; &amp;nbsp; "operation": "shift",
&amp;nbsp; &amp;nbsp; "spec": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; "nummer": "Nummer",
&amp;nbsp; &amp;nbsp; &amp;nbsp; "table": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "*": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "zn": "Positionen.[#2].ZeileNr",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "datum": "Positionen.[#2].Datum"
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}]&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 May 2019 09:37:41 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2019-05-24T09:37:41Z</dc:date>
    <item>
      <title>NiFi - Need help with JOLT-Syntax JoltTransformJSON</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Need-help-with-JOLT-Syntax-JoltTransformJSON/m-p/241060#M202864</link>
      <description>&lt;P&gt;Hi, I need some help with JOLT-syntax.&lt;/P&gt;&lt;P&gt;JSON-Input&lt;/P&gt;&lt;PRE&gt;{
&amp;nbsp; "nummer": "1073",
&amp;nbsp; "table": [
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; "datum": "20180529",
&amp;nbsp; &amp;nbsp; &amp;nbsp; "zn": 1
&amp;nbsp; &amp;nbsp; },
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; "datum": "20180530",
&amp;nbsp; &amp;nbsp; &amp;nbsp; "zn": 2
&amp;nbsp; &amp;nbsp; },
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; "datum": "20190522",
&amp;nbsp; &amp;nbsp; &amp;nbsp; "zn": 3
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; ]
}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;JOLT-Specification&lt;/P&gt;&lt;PRE&gt;[{
&amp;nbsp; &amp;nbsp; "operation": "shift",
&amp;nbsp; &amp;nbsp; "spec": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; "nummer": "Nummer",
&amp;nbsp; &amp;nbsp; &amp;nbsp; "table": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "*": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "zn": "Positionen.[].ZeileNr",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "datum": "Positionen.[].Datum"
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}
]&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;JSON-Output&lt;/P&gt;&lt;PRE&gt;{
&amp;nbsp; &amp;nbsp; "Nummer": "1073",
&amp;nbsp; &amp;nbsp; "Positionen": [{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "ZeileNr": 1
&amp;nbsp; &amp;nbsp; }, {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Datum": "20180529"
&amp;nbsp; &amp;nbsp; }, {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "ZeileNr": 2
&amp;nbsp; &amp;nbsp; }, {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Datum": "20180530"
&amp;nbsp; &amp;nbsp; }, {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "ZeileNr": 3
&amp;nbsp; &amp;nbsp; }, {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Datum": "20190522"
&amp;nbsp; &amp;nbsp; }]
}&lt;/PRE&gt;&lt;P&gt;But the JSON-Output what I need is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;{
&amp;nbsp; &amp;nbsp;&amp;nbsp;"Nummer": "1073",
&amp;nbsp; &amp;nbsp;&amp;nbsp;"Positionen": [{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"ZeileNr": 1,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"Datum": "20180529"
&amp;nbsp; &amp;nbsp;&amp;nbsp;}, {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"ZeileNr": 2,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"Datum": "20180530"
&amp;nbsp; &amp;nbsp;&amp;nbsp;}, {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"ZeileNr": 3,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"Datum": "20190522"
&amp;nbsp; &amp;nbsp;&amp;nbsp;}]
}&lt;/PRE&gt;&lt;P&gt;Please, how can I manage this, it is driving me crazy...&lt;/P&gt;&lt;P&gt;Thanks for any help and information about this syntax!&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 16:22:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Need-help-with-JOLT-Syntax-JoltTransformJSON/m-p/241060#M202864</guid>
      <dc:creator>justenji</dc:creator>
      <dc:date>2019-05-23T16:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - Need help with JOLT-Syntax JoltTransformJSON</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Need-help-with-JOLT-Syntax-JoltTransformJSON/m-p/241061#M202865</link>
      <description>&lt;P&gt;You were so close! By using the [] syntax it just adds to the outgoing array, but you wanted to associate them with the same index, namely the one matched by the * "above" the fields. Put #2 inside your braces (#2 is a reference to the array index you're iterating over, "two levels up" from where you are in the spec):&lt;/P&gt;&lt;PRE&gt;[{
&amp;nbsp; &amp;nbsp; "operation": "shift",
&amp;nbsp; &amp;nbsp; "spec": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; "nummer": "Nummer",
&amp;nbsp; &amp;nbsp; &amp;nbsp; "table": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "*": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "zn": "Positionen.[#2].ZeileNr",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "datum": "Positionen.[#2].Datum"
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}]&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2019 09:37:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Need-help-with-JOLT-Syntax-JoltTransformJSON/m-p/241061#M202865</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2019-05-24T09:37:41Z</dc:date>
    </item>
  </channel>
</rss>

