<?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 for moving  json message to subset without mapping all the fields one by one in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Jolt-transform-for-moving-json-message-to-subset-without/m-p/222390#M82318</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/92267/saravanansastra.html" nodeid="92267" target="_blank"&gt;@Saravanan Subramanian&lt;/A&gt;&lt;P&gt;&lt;STRONG&gt;Try with below Jolt Spec:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": "Data.&amp;amp;"
    }
  },
  {
    "operation": "default",
    "spec": {
      "Data": {}
    }
  }
]


&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Input:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "primary": {
    "value": 4
  },
  "quality": {
    "value": 3
  }
}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "Data" : {
    "primary" : {
      "value" : 4
    },
    "quality" : {
      "value" : 3
    }
  }
}&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="86580-jolt.png" style="width: 3694px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15711i1AF93E3F4D4DEF4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="86580-jolt.png" alt="86580-jolt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Another way of doing this is using &lt;STRONG&gt;Replace Text&lt;/STRONG&gt; processor by capturing all the content of flowfile and replacement value as &lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;(^.*$)&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;{ "Data": $1 }&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Character Set
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer&lt;/STRONG&gt;, That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 02:08:10 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T02:08:10Z</dc:date>
    <item>
      <title>Jolt transform for moving  json message to subset without mapping all the fields one by one</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Jolt-transform-for-moving-json-message-to-subset-without/m-p/222389#M82317</link>
      <description>&lt;P&gt;I'm to Jolt transformation. I have a simple requirement to transform a json message, were I have to move the contents of the message to a subset without mapping the filed one by one. Input message: {        "primary": {       "value": 4     },     "quality": {       "value": 3     }    }  Expected Output:  { Data:{      "primary": {       "value": 4     },     "quality": {       "value": 3     } } }.,HI, I am looking to convert a json message using Jolt. it is a simple transformation, were i have to move the entire json message to a subset without mapping field by field&lt;/P&gt;&lt;P&gt;@Matt Burgess&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 03:48:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Jolt-transform-for-moving-json-message-to-subset-without/m-p/222389#M82317</guid>
      <dc:creator>saravanan_sastr</dc:creator>
      <dc:date>2018-08-17T03:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Jolt transform for moving  json message to subset without mapping all the fields one by one</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Jolt-transform-for-moving-json-message-to-subset-without/m-p/222390#M82318</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/92267/saravanansastra.html" nodeid="92267" target="_blank"&gt;@Saravanan Subramanian&lt;/A&gt;&lt;P&gt;&lt;STRONG&gt;Try with below Jolt Spec:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": "Data.&amp;amp;"
    }
  },
  {
    "operation": "default",
    "spec": {
      "Data": {}
    }
  }
]


&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Input:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "primary": {
    "value": 4
  },
  "quality": {
    "value": 3
  }
}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "Data" : {
    "primary" : {
      "value" : 4
    },
    "quality" : {
      "value" : 3
    }
  }
}&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="86580-jolt.png" style="width: 3694px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15711i1AF93E3F4D4DEF4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="86580-jolt.png" alt="86580-jolt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Another way of doing this is using &lt;STRONG&gt;Replace Text&lt;/STRONG&gt; processor by capturing all the content of flowfile and replacement value as &lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;(^.*$)&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;{ "Data": $1 }&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Character Set
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer&lt;/STRONG&gt;, That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 02:08:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Jolt-transform-for-moving-json-message-to-subset-without/m-p/222390#M82318</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T02:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Jolt transform for moving  json message to subset without mapping all the fields one by one</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Jolt-transform-for-moving-json-message-to-subset-without/m-p/222391#M82319</link>
      <description>&lt;P&gt;Thanks very much &lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; for your solution . I managed to find a way which is almost similar to yours. &lt;/P&gt;</description>
      <pubDate>Sun, 19 Aug 2018 06:40:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Jolt-transform-for-moving-json-message-to-subset-without/m-p/222391#M82319</guid>
      <dc:creator>saravanan_sastr</dc:creator>
      <dc:date>2018-08-19T06:40:34Z</dc:date>
    </item>
  </channel>
</rss>

