<?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: How  do I  extract the attributes from the below json in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/289997#M214601</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/74353"&gt;@Slade&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all I think there is a { missing at the begin of your JSON.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try here for example:&amp;nbsp;&lt;A href="http://jsonpath.herokuapp.com/" target="_blank"&gt;http://jsonpath.herokuapp.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically it works with&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;$.outputs..name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 17:50:34 GMT</pubDate>
    <dc:creator>justenji</dc:creator>
    <dc:date>2020-02-18T17:50:34Z</dc:date>
    <item>
      <title>How  do I  extract the attributes from the below json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/289989#M214599</link>
      <description>&lt;P&gt;Please can you give me an example of how i would extract the "test" values from the below json&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the following but not winning ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$.outputs.name.test1&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$.test1&lt;/P&gt;
&lt;P&gt;$.outputs.test1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the processor "evaluate json path"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The below is a response from a webservice I am calling . I want the "test" values to be inserted in a sql table&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"outputs": [&lt;BR /&gt;{&lt;BR /&gt;"name": "test1",&lt;BR /&gt;"value": "1"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "test2",&lt;BR /&gt;"value": 0.9512272865085364&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "test3",&lt;BR /&gt;"value": 0.9512272865085364&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "test4",&lt;BR /&gt;"value": "1"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "test5",&lt;BR /&gt;"value": 4.4659&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "test6",&lt;BR /&gt;"value": 0.048772713491463618&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 19:17:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/289989#M214599</guid>
      <dc:creator>Slade</dc:creator>
      <dc:date>2020-02-18T19:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: How  do I  extract the attributes from the below json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/289997#M214601</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/74353"&gt;@Slade&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all I think there is a { missing at the begin of your JSON.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try here for example:&amp;nbsp;&lt;A href="http://jsonpath.herokuapp.com/" target="_blank"&gt;http://jsonpath.herokuapp.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically it works with&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;$.outputs..name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 17:50:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/289997#M214601</guid>
      <dc:creator>justenji</dc:creator>
      <dc:date>2020-02-18T17:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: How  do I  extract the attributes from the below json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/289999#M214603</link>
      <description>&lt;P&gt;As mentioned above, make sure you are sending full JSON Object. &amp;nbsp;Then in your EvaluateJsonPath processor click a + for each one you want to map to an attribute. &amp;nbsp;Then enter the key → values as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;test1 → $.outputs.test1&lt;/P&gt;
&lt;P&gt;test2 → $.outputs.test2&lt;/P&gt;
&lt;P&gt;test3 →&amp;nbsp;$.outputs.test3&lt;/P&gt;
&lt;P&gt;test4 →&amp;nbsp;$.outputs.test4&lt;/P&gt;
&lt;P&gt;test5 →&amp;nbsp;$.outputs.test5&lt;/P&gt;
&lt;P&gt;test6 →&amp;nbsp;$.outputs.test6&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this solution works please accept it as the solution to close the topic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 19:16:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/289999#M214603</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-02-18T19:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How  do I  extract the attributes from the below json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290014#M214612</link>
      <description>&lt;P&gt;Thanks for your help&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/60150"&gt;@stevenmatison&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/67599"&gt;@justenji&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to get the below json attributes successfully&amp;nbsp; with simple $.AtrributeName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"test" : "7",&lt;BR /&gt;"dm0001al" : "-2",&lt;BR /&gt;"pp0406ln" : "5",&lt;BR /&gt;"pp0935cl" : "121",&lt;BR /&gt;"eq0001fl" : "-1",&lt;BR /&gt;"pp0406cl" : "1352",&lt;BR /&gt;"pp0934cc" : "-2",&lt;BR /&gt;"pp0026al" : "0",&lt;BR /&gt;"pp0035al" : "8",&lt;BR /&gt;"pp0901lb" : "-2",&lt;BR /&gt;"id" : 4,&lt;BR /&gt;"inputs" : [ {&lt;BR /&gt;"name" : "test",&lt;BR /&gt;"value" : 3&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "dm0001al",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0406ln",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0935cl",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "eq0001fl",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0406cl",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0934cc",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0026al",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0035al",&lt;BR /&gt;"value" : 1&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0901lb",&lt;BR /&gt;"value" : 1&lt;BR /&gt;} ]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am still struggling with the below one I tried a couple of tricks in EvalutuateIJson processor but still not values are assigning to attributes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The content of my incoming flow is in full JSon and looks like the below. This is the full json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"outputs" : [ {&lt;BR /&gt;"name" : "EM_CLASSIFICATION",&lt;BR /&gt;"value" : "1"&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "EM_EVENTPROBABILITY",&lt;BR /&gt;"value" : 0.9512272865085364&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "EM_PROBABILITY",&lt;BR /&gt;"value" : 0.9512272865085364&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "I_Responded",&lt;BR /&gt;"value" : "1"&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "MSLR_woe",&lt;BR /&gt;"value" : 4.4659&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "P_Responded0",&lt;BR /&gt;"value" : 0.048772713491463615&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "P_Responded1",&lt;BR /&gt;"value" : 0.9512272865085364&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "dm0001al_woe",&lt;BR /&gt;"value" : 0.853&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "eq0001fl_woe",&lt;BR /&gt;"value" : 0.9315&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0026al_woe",&lt;BR /&gt;"value" : -0.2929&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0035al_woe",&lt;BR /&gt;"value" : 0.5839&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0406cl_woe",&lt;BR /&gt;"value" : 0.6062&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0406ln_woe",&lt;BR /&gt;"value" : 1.3878&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0901lb_woe",&lt;BR /&gt;"value" : 0.1952&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0934cc_woe",&lt;BR /&gt;"value" : -1.3256&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pp0935cl_woe",&lt;BR /&gt;"value" : -0.5781&lt;BR /&gt;} ]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$.outputs.pp0935cl_woe&amp;nbsp;&lt;/P&gt;&lt;P&gt;$.outputs..pp0935cl_woe&lt;/P&gt;&lt;P&gt;$.['pp0935cl_woe']&lt;/P&gt;&lt;P&gt;$.outputs.name.pp0935cl_woe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still nothing coming through in the attributes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 22:17:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290014#M214612</guid>
      <dc:creator>Slade</dc:creator>
      <dc:date>2020-02-18T22:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: How  do I  extract the attributes from the below json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290019#M214617</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$.outputs.['&lt;SPAN&gt;EM_CLASSIFICATION'&lt;/SPAN&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that's $.mainobject.['array name'] to access the value for that outputs array item&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fun with Json...&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 00:37:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290019#M214617</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-02-19T00:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: How  do I  extract the attributes from the below json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290047#M214637</link>
      <description>&lt;P&gt;Tried it still nothing assigning&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and tried all the below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$.['EM_CLASSIFICATION']&lt;/P&gt;&lt;P&gt;$.{EM_CLASSIFICATION}&lt;/P&gt;&lt;P&gt;$.{'EM_CLASSIFICATION'}&lt;/P&gt;&lt;P&gt;$.'{outputs.EM_CLASSIFICATION}'&lt;/P&gt;&lt;P&gt;$.outputs.{'EM_CLASSIFICATION'}&lt;/P&gt;&lt;P&gt;$.outputs.{EM_CLASSIFICATION}&lt;/P&gt;&lt;P&gt;$.outputs.{'name.EM_CLASSIFICATION'}&lt;/P&gt;&lt;P&gt;$.outputs.['..EM_CLASSIFICATION']&lt;/P&gt;&lt;P&gt;$.outputs.{'name'..'EM_CLASSIFICATION'}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;might just plonk the full json in nvarchar field in sql and sql it out properly over their.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 07:12:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290047#M214637</guid>
      <dc:creator>Slade</dc:creator>
      <dc:date>2020-02-19T07:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How  do I  extract the attributes from the below json</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290050#M214639</link>
      <description>&lt;P&gt;Ok so me and my mate figured it out :). Finally!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$.outputs[?(@.name=="EM_CLASSIFICATION")].value&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 08:04:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-extract-the-attributes-from-the-below-json/m-p/290050#M214639</guid>
      <dc:creator>Slade</dc:creator>
      <dc:date>2020-02-19T08:04:27Z</dc:date>
    </item>
  </channel>
</rss>

