<?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 spec to decide the value based on content in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/JOLT-spec-to-decide-the-value-based-on-content/m-p/194588#M156648</link>
    <description>&lt;P&gt;You should be able to use UpdateAttribute with ExpressionLanguage (probably the ifElse() function along with isNull()) in order to set http.headers.orgId to http.headers.OrgID if it is not already populated. Then you can keep the JOLT spec as-is.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 20:36:09 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2018-03-21T20:36:09Z</dc:date>
    <item>
      <title>JOLT spec to decide the value based on content</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JOLT-spec-to-decide-the-value-based-on-content/m-p/194587#M156647</link>
      <description>&lt;P&gt;I am enriching my request payload with the payload attribute 'http.headers.orgId' and its working fine.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SPEC&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;[{
"operation": "default", &lt;/P&gt;&lt;P&gt;"spec": { &lt;/P&gt;&lt;P&gt;"*": {
"orgId": "${http.headers.orgId}"
} &lt;/P&gt;&lt;P&gt;            } &lt;/P&gt;&lt;P&gt;}]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INPUT&lt;/STRONG&gt; :&lt;/P&gt;&lt;P&gt;{
    "drivewiseDeviceData": {
        "imei": "sampleimei",
        "tripId": "3d9df81a-1828-40eb-940e-d2434eb5f50f",
        "sumVer": null,
        "payloadType": "Binary",
        "packetInfo": "",
        "payloadData": "g1bjSWX",
        "recordinfo": null,
        "sequenceNum": null,
        "timeStamp": "2017-05-26T12:07:29.968Z" }
}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OUTPUT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{ "drivewiseDeviceData": { "imei": "sampleimei", "tripId": "3d9df81a-1828-40eb-940e-d2434eb5f50f", "sumVer": null, "payloadType": "Binary", "packetInfo": "", "payloadData": "g1bjSWX", "recordinfo": null, "sequenceNum": null, "timeStamp": "2017-05-26T12:07:29.968Z", "orgId": "Sample Org Name Here" } }&lt;/P&gt;&lt;P&gt;.........................................................................................................................................&lt;/P&gt;&lt;P&gt;Now scenarios is I may get header attribute as 'http.headers.OrgID' or 'http.headers.orgId', &lt;/P&gt;&lt;P&gt;So is there any way to handle both scenarios in my JOLT spec?&lt;/P&gt;&lt;P&gt; If 'http.headers.orgId' value is null/empty/attribute-not-present then I should use 'http.headers.OrgID' for enrich.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 18:09:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JOLT-spec-to-decide-the-value-based-on-content/m-p/194587#M156647</guid>
      <dc:creator>hegdemahendra</dc:creator>
      <dc:date>2018-03-19T18:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: JOLT spec to decide the value based on content</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JOLT-spec-to-decide-the-value-based-on-content/m-p/194588#M156648</link>
      <description>&lt;P&gt;You should be able to use UpdateAttribute with ExpressionLanguage (probably the ifElse() function along with isNull()) in order to set http.headers.orgId to http.headers.OrgID if it is not already populated. Then you can keep the JOLT spec as-is.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 20:36:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JOLT-spec-to-decide-the-value-based-on-content/m-p/194588#M156648</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2018-03-21T20:36:09Z</dc:date>
    </item>
  </channel>
</rss>

