<?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 to reference a key/value pair from JSON of different structure in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343552#M233958</link>
    <description>&lt;P&gt;Not sure if this is the the most efficient way, but you can use ExtractText by creating new attribute with the following regular expression:&amp;nbsp;&lt;/P&gt;&lt;P&gt;(?&amp;lt;=\"requestUid\":\s")[A-Z-a-z-0-9\-]+&lt;/P&gt;&lt;P&gt;Not sure if you can accomplish that using evaluatejsonPath processor, but given that the path can be different its probably hard to accomplish&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 19:31:28 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2022-05-10T19:31:28Z</dc:date>
    <item>
      <title>How to reference a key/value pair from JSON of different structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343535#M233951</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please, is there a way to reference a key part of JSON file that can come in different structures.&lt;/P&gt;&lt;P&gt;For example i want to get the value of &lt;STRONG&gt;"requestUid"&lt;/STRONG&gt; from these different JSON structures just with a single processor. So, irrespective of JSON formats or structures sent, i would want to get the value of&amp;nbsp;&lt;STRONG&gt;requestUid.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"responseMetaData": {&lt;BR /&gt;"type": "ACK",&lt;BR /&gt;"userId": "SYSTEM",&lt;BR /&gt;&lt;STRONG&gt;"requestUid": "1742963e-f02f-4db6-88e0-6af8c4d4825b",,&lt;/STRONG&gt;&lt;BR /&gt;"systemId": "CIF",&lt;BR /&gt;"serviceId": "FR_CUS"&lt;BR /&gt;},&lt;BR /&gt;"responseDataObject": {&lt;BR /&gt;"result": "Accepted",&lt;BR /&gt;"responseCode": "SUC",&lt;BR /&gt;"responseMessage": "",&lt;BR /&gt;"execTime": "1216"&lt;BR /&gt;}&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"responseMetaData": {&lt;BR /&gt;"type": "ACK",&lt;BR /&gt;"sendTime": "23/03/2019 09:16:25.305277",&lt;BR /&gt;"timeZone": "4",&lt;BR /&gt;"userId": "SYSTEM",&lt;BR /&gt;"branchCompanyId": "784100",&lt;BR /&gt;"branchLocationId": "784101",&lt;BR /&gt;"systemId": "CIF",&lt;BR /&gt;"serviceId": "FR_CUS"&lt;BR /&gt;},&lt;BR /&gt;"responseDataObject": {&lt;BR /&gt;"result": "Accepted",&lt;BR /&gt;"responseCode": "SUC",&lt;/P&gt;&lt;P&gt;"&lt;STRONG&gt;requestUid&lt;/STRONG&gt;":&lt;STRONG&gt; "yywhhnan56289200200",&lt;/STRONG&gt;&lt;BR /&gt;"execTime": "1216"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 12:49:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343535#M233951</guid>
      <dc:creator>rafy</dc:creator>
      <dc:date>2022-05-10T12:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a key/value pair from JSON of different structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343552#M233958</link>
      <description>&lt;P&gt;Not sure if this is the the most efficient way, but you can use ExtractText by creating new attribute with the following regular expression:&amp;nbsp;&lt;/P&gt;&lt;P&gt;(?&amp;lt;=\"requestUid\":\s")[A-Z-a-z-0-9\-]+&lt;/P&gt;&lt;P&gt;Not sure if you can accomplish that using evaluatejsonPath processor, but given that the path can be different its probably hard to accomplish&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 19:31:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343552#M233958</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-05-10T19:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a key/value pair from JSON of different structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343554#M233960</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;SAMSAL,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you so much. I got it working using your method at the moment.&lt;/P&gt;&lt;P&gt;Please, can you explain this RE to me or point me to a suitable material where i can learn this particular Regular Expression.&lt;/P&gt;&lt;P&gt;I really appreciate.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 20:00:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343554#M233960</guid>
      <dc:creator>rafy</dc:creator>
      <dc:date>2022-05-10T20:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a key/value pair from JSON of different structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343555#M233961</link>
      <description>&lt;P&gt;There is a lot of articles\videos around learning Regular Expression. The one I provided using what is called positive lookbehind (?&amp;lt;=), which means: find the Id which contain alphanumeric characters with hyphen (-) that is proceeded (lookbehind) with the text "requestUid"&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 20:15:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343555#M233961</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-05-10T20:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a key/value pair from JSON of different structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343556#M233962</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 20:53:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-reference-a-key-value-pair-from-JSON-of-different/m-p/343556#M233962</guid>
      <dc:creator>rafy</dc:creator>
      <dc:date>2022-05-10T20:53:15Z</dc:date>
    </item>
  </channel>
</rss>

