<?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: What Jolt transform will extract fields from the provided JSON, and copy them to the top of the json structure in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221353#M84443</link>
    <description>&lt;P&gt;Thank You. I am brand new to jolt and am finding it a bit of a confusing syntax. I will get there however. It seems powerful. Do you have a description of what the following is doing:&lt;/P&gt;&lt;OL&gt;
&lt;/OL&gt;&lt;PRE&gt;"@":"&amp;amp;2.&amp;amp;"&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Oct 2018 17:14:02 GMT</pubDate>
    <dc:creator>dave_sargrad</dc:creator>
    <dc:date>2018-10-19T17:14:02Z</dc:date>
    <item>
      <title>What Jolt transform will extract fields from the provided JSON, and copy them to the top of the json structure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221350#M84440</link>
      <description>&lt;P&gt;I have the following JSON. I'd like to transform the JSON by extracting the "issued" field ("issued":"2018-10-17T20:16:00.000Z") and outputting a new JSON that preserves the existing JSON, but appends a new JSON that would contain a new property  &lt;/P&gt;&lt;P&gt;"issued_datetime":"2018-10-17T20:16:00.000Z". I'd also like to extract the effectiveStart and effectiveEnd and add them to the top level of the output JSON as well. So the output JSON would be the input JSON, with 3 properties added to it (replicas of issued, effectiveStart, effectiveEnd).&lt;/P&gt;&lt;P&gt;Could someone please help me with the JOLT transform that would facilitate this.&lt;/P&gt;&lt;P&gt;Input JSON:&lt;/P&gt;&lt;PRE&gt;{
  "textNOTAM": {
    "NOTAM": {
      "id": "NOTAM_1_51125176",
      "number": 108,
      "year": 2018,
      "type": "N",
      "issued": "2018-10-17T20:16:00.000Z",
      "affectedFIR": "ZOA",
      "minimumFL": "000",
      "maximumFL": 999,
      "radius": 5,
      "location": "SCK",
      "effectiveStart": 201810201100,
      "effectiveEnd": 201811032000,
      "schedule": "SAT SUN",
      "text": "SVC PCL RWY 11L/29R REDL OUT OF SERVICE SAT SUN 1100-2000",
      "translation": [
        {
          "NOTAMTranslation": {
            "id": "NT01_51125176",
            "type": "LOCAL_FORMAT",
            "simpleText": "!SCK 10/108 SCK SVC PCL RWY 11L/29R REDL OUT OF SERVICE SAT SUN 1100-2000 1810201100-1811032000"
          }
        },
        {
          "NOTAMTranslation": {
            "id": "NT02_51125176",
            "type": "OTHER:ICAO",
            "formattedText": {
              "div": "10/108 NOTAMR \r\nQ) ZOA/QLEXX/IV/NBO/A/000/999/3753N12114W005 \r\nA) KSCK \r\nB) 1810201100 \r\nC) 1811032000 \r\n D) SAT SUN 1100-2000 \r\n\r\nE) \r\nSVC PCL RWY 11L/29R REDL PCL OUT OF SERVICE"
            }
          }
        }
      ]
    }
  }
}
&amp;lt;br&amp;gt;&lt;/PRE&gt;&lt;P&gt;Desired Output JSON:&lt;/P&gt;&lt;PRE&gt;{     
"issued":"2018-10-17T20:16:00.000Z",   
"effectiveStart":201810201100,   
"effectiveEnd":201811032000,   {
  "textNOTAM": {
    "NOTAM": {
      "id": "NOTAM_1_51125176",
      "number": 108,
      "year": 2018,
      "type": "N",
      "issued": "2018-10-17T20:16:00.000Z",
      "affectedFIR": "ZOA",
      "minimumFL": "000",
      "maximumFL": 999,
      "radius": 5,
      "location": "SCK",
      "effectiveStart": 201810201100,
      "effectiveEnd": 201811032000,
      "schedule": "SAT SUN",
      "text": "SVC PCL RWY 11L/29R REDL OUT OF SERVICE SAT SUN 1100-2000",
      "translation": [
        {
          "NOTAMTranslation": {
            "id": "NT01_51125176",
            "type": "LOCAL_FORMAT",
            "simpleText": "!SCK 10/108 SCK SVC PCL RWY 11L/29R REDL OUT OF SERVICE SAT SUN 1100-2000 1810201100-1811032000"
          }
        },
        {
          "NOTAMTranslation": {
            "id": "NT02_51125176",
            "type": "OTHER:ICAO",
            "formattedText": {
              "div": "10/108 NOTAMR \r\nQ) ZOA/QLEXX/IV/NBO/A/000/999/3753N12114W005 \r\nA) KSCK \r\nB) 1810201100 \r\nC) 1811032000 \r\n D) SAT SUN 1100-2000 \r\n\r\nE) \r\nSVC PCL RWY 11L/29R REDL PCL OUT OF SERVICE"
            }
          }
        }
      ]
    }
  }
}
}&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 19:45:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221350#M84440</guid>
      <dc:creator>dave_sargrad</dc:creator>
      <dc:date>2018-10-18T19:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: What Jolt transform will extract fields from the provided JSON, and copy them to the top of the json structure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221351#M84441</link>
      <description>&lt;P&gt;I think I'm getting close with the following spec:&lt;/P&gt;&lt;PRE&gt;[
  {
    "operation": "shift",
    "spec": {
      "textNOTAM": {
        "NOTAM": {
          // simple match.  Put the value '4' in the output under the "Rating" field
          "issued": "&amp;amp;0",
          "affectedFIR": "&amp;amp;0"
        }
      }
    }
}, {
    "operation": "default",
    "spec": {}
}]

The output has extracted fields.. but it does not also contain the original

{
  "issued" : "2018-10-17T20:16:00.000Z",
  "affectedFIR" : "ZOA"
}

&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 22:23:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221351#M84441</guid>
      <dc:creator>dave_sargrad</dc:creator>
      <dc:date>2018-10-18T22:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: What Jolt transform will extract fields from the provided JSON, and copy them to the top of the json structure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221352#M84442</link>
      <description>&lt;P&gt;@@David Sargrad,&lt;/P&gt;&lt;P&gt;you can use this specification,&lt;/P&gt;&lt;PRE&gt;[
  {
    "operation": "shift",
    "spec": {
      "textNOTAM": {
        "NOTAM": {
          "issued": "issued",
          "effectiveStart": "effectiveStart",
          "effectiveEnd": "effectiveEnd",
          "@": "&amp;amp;2.&amp;amp;"
        }
      }
    }
  }
]
&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 13:00:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221352#M84442</guid>
      <dc:creator>sohil2027</dc:creator>
      <dc:date>2018-10-19T13:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: What Jolt transform will extract fields from the provided JSON, and copy them to the top of the json structure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221353#M84443</link>
      <description>&lt;P&gt;Thank You. I am brand new to jolt and am finding it a bit of a confusing syntax. I will get there however. It seems powerful. Do you have a description of what the following is doing:&lt;/P&gt;&lt;OL&gt;
&lt;/OL&gt;&lt;PRE&gt;"@":"&amp;amp;2.&amp;amp;"&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:14:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221353#M84443</guid>
      <dc:creator>dave_sargrad</dc:creator>
      <dc:date>2018-10-19T17:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: What Jolt transform will extract fields from the provided JSON, and copy them to the top of the json structure</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221354#M84444</link>
      <description>&lt;P&gt;@David Sargard,&lt;/P&gt;&lt;P&gt;"@" copies whatever is present at the current level, and copies it to "&amp;amp;2.&amp;amp;"&lt;/P&gt;&lt;P&gt;Here &amp;amp;2 means go up two levels and grab the key, and &amp;amp; means go up one level and grab the key.&lt;/P&gt;&lt;P&gt;i.e., &amp;amp;2 will return textNOTAM and &amp;amp; will return NOTAM, so &amp;amp;2.&amp;amp; will place whatever value you get at the following jsonPath: textNOTAM.NOTAM&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:26:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-Jolt-transform-will-extract-fields-from-the-provided/m-p/221354#M84444</guid>
      <dc:creator>sohil2027</dc:creator>
      <dc:date>2018-10-19T18:26:32Z</dc:date>
    </item>
  </channel>
</rss>

