<?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: Add attribute to json with jolt transform in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Add-attribute-to-json-with-jolt-transform/m-p/352019#M236422</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont think you need the &lt;STRONG&gt;asterisk&lt;/STRONG&gt; "*" in the spec, since you need it on the first level and you dont need to reference any other fields. Just have your spec as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "modify-default-beta",
    "spec": {
      "target.organisation": "${target.organisation}"
    }
  }
]&lt;/LI-CODE&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>Mon, 12 Sep 2022 14:39:25 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2022-09-12T14:39:25Z</dc:date>
    <item>
      <title>Add attribute to json with jolt transform</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Add-attribute-to-json-with-jolt-transform/m-p/351998#M236418</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;i would like to add an attribute to the following json file using the jolt transfomr processor. Unfortunately my json file remains unchanged with the following transformation&lt;/P&gt;
&lt;P&gt;Original Json File&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "logs": [],
  "ranges": [
    {
      "day": "2022-08-31T22:00:00.000Z",
      "manager": {
        "costByRemunerationId": [],
        "total": 0,
        "totalHours": 0,
        "ancillaryCost": 0
      },
      "crew": {
        "costByRemunerationId": [
          {
            "remunerationId": "salary",
            "remunerationUnit": 2,
            "compensation": 76.66666666666667,
            "worktimeInH": 0,
            "durationInDays": 0,
            "quantity": 0,
            "ancillaryCost": 15.854666666666667
          }
        ],
        "total": 76.66666666666667,
        "totalHours": 0,
        "ancillaryCost": 15.854666666666667
      },
      "trainee": {
        "costByRemunerationId": [],
        "total": 0,
        "totalHours": 0,
        "ancillaryCost": 0
      },
      "apprentice": {
        "costByRemunerationId": [],
        "total": 0,
        "totalHours": 0,
        "ancillaryCost": 0
      },
      "total": 76.66666666666667,
      "totalHours": 0,
      "ancillaryCost": 15.854666666666667
    },
    {
      "day": "2022-09-01T22:00:00.000Z",
      "manager": {
        "costByRemunerationId": [],
        "total": 0,
        "totalHours": 0,
        "ancillaryCost": 0
      },
      "crew": {
        "costByRemunerationId": [
          {
            "remunerationId": "normalHours",
            "remunerationUnit": 0,
            "compensation": 0,
            "worktimeInH": 7.8329297222222225,
            "durationInDays": 2,
            "quantity": 0,
            "ancillaryCost": 0
          },
          {
            "remunerationId": "salary",
            "remunerationUnit": 2,
            "compensation": 76.66666666666667,
            "worktimeInH": 0,
            "durationInDays": 0,
            "quantity": 0,
            "ancillaryCost": 15.854666666666667
          }
        ],
        "total": 76.66666666666667,
        "totalHours": 7.8329297222222225,
        "ancillaryCost": 15.854666666666667
      },
      "trainee": {
        "costByRemunerationId": [],
        "total": 0,
        "totalHours": 0,
        "ancillaryCost": 0
      },
      "apprentice": {
        "costByRemunerationId": [],
        "total": 0,
        "totalHours": 0,
        "ancillaryCost": 0
      },
      "total": 76.66666666666667,
      "totalHours": 7.8329297222222225,
      "ancillaryCost": 15.854666666666667
    }
  ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Jolt Transform&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "modify-default-beta",
    "spec": {
      "*": {
        "target.organisation": "${target.organisation}"
      }
    }
  }
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected result&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"logs": [],&lt;BR /&gt;"ranges": [&lt;BR /&gt;{&lt;BR /&gt;"day": "2022-08-31T22:00:00.000Z",&lt;BR /&gt;"manager": {&lt;BR /&gt;"costByRemunerationId": [],&lt;BR /&gt;"total": 0,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 0&lt;BR /&gt;},&lt;BR /&gt;"crew": {&lt;BR /&gt;"costByRemunerationId": [&lt;BR /&gt;{&lt;BR /&gt;"remunerationId": "salary",&lt;BR /&gt;"remunerationUnit": 2,&lt;BR /&gt;"compensation": 76.66666666666667,&lt;BR /&gt;"worktimeInH": 0,&lt;BR /&gt;"durationInDays": 0,&lt;BR /&gt;"quantity": 0,&lt;BR /&gt;"ancillaryCost": 15.854666666666667&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"total": 76.66666666666667,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 15.854666666666667&lt;BR /&gt;},&lt;BR /&gt;"trainee": {&lt;BR /&gt;"costByRemunerationId": [],&lt;BR /&gt;"total": 0,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 0&lt;BR /&gt;},&lt;BR /&gt;"apprentice": {&lt;BR /&gt;"costByRemunerationId": [],&lt;BR /&gt;"total": 0,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 0&lt;BR /&gt;},&lt;BR /&gt;"total": 76.66666666666667,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 15.854666666666667&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"day": "2022-09-01T22:00:00.000Z",&lt;BR /&gt;"manager": {&lt;BR /&gt;"costByRemunerationId": [],&lt;BR /&gt;"total": 0,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 0&lt;BR /&gt;},&lt;BR /&gt;"crew": {&lt;BR /&gt;"costByRemunerationId": [&lt;BR /&gt;{&lt;BR /&gt;"remunerationId": "normalHours",&lt;BR /&gt;"remunerationUnit": 0,&lt;BR /&gt;"compensation": 0,&lt;BR /&gt;"worktimeInH": 7.8329297222222225,&lt;BR /&gt;"durationInDays": 2,&lt;BR /&gt;"quantity": 0,&lt;BR /&gt;"ancillaryCost": 0&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"remunerationId": "salary",&lt;BR /&gt;"remunerationUnit": 2,&lt;BR /&gt;"compensation": 76.66666666666667,&lt;BR /&gt;"worktimeInH": 0,&lt;BR /&gt;"durationInDays": 0,&lt;BR /&gt;"quantity": 0,&lt;BR /&gt;"ancillaryCost": 15.854666666666667&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"total": 76.66666666666667,&lt;BR /&gt;"totalHours": 7.8329297222222225,&lt;BR /&gt;"ancillaryCost": 15.854666666666667&lt;BR /&gt;},&lt;BR /&gt;"trainee": {&lt;BR /&gt;"costByRemunerationId": [],&lt;BR /&gt;"total": 0,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 0&lt;BR /&gt;},&lt;BR /&gt;"apprentice": {&lt;BR /&gt;"costByRemunerationId": [],&lt;BR /&gt;"total": 0,&lt;BR /&gt;"totalHours": 0,&lt;BR /&gt;"ancillaryCost": 0&lt;BR /&gt;},&lt;BR /&gt;"total": 76.66666666666667,&lt;BR /&gt;"totalHours": 7.8329297222222225,&lt;BR /&gt;"ancillaryCost": 15.854666666666667&lt;BR /&gt;}&lt;BR /&gt;],&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;"target.organisation": myorganisation&lt;/FONT&gt;&amp;nbsp;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;Thanks for idea what is still missing from my query&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 16:37:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Add-attribute-to-json-with-jolt-transform/m-p/351998#M236418</guid>
      <dc:creator>MarioFRS</dc:creator>
      <dc:date>2022-09-12T16:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Add attribute to json with jolt transform</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Add-attribute-to-json-with-jolt-transform/m-p/352019#M236422</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont think you need the &lt;STRONG&gt;asterisk&lt;/STRONG&gt; "*" in the spec, since you need it on the first level and you dont need to reference any other fields. Just have your spec as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "modify-default-beta",
    "spec": {
      "target.organisation": "${target.organisation}"
    }
  }
]&lt;/LI-CODE&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>Mon, 12 Sep 2022 14:39:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Add-attribute-to-json-with-jolt-transform/m-p/352019#M236422</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-09-12T14:39:25Z</dc:date>
    </item>
  </channel>
</rss>

