<?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>topic Re: multiple case statement not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574012#M200040</link>
    <description>&lt;P&gt;You would need to expand the event into multiple events, try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mvexapnd 'data.environments{}.id'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Nov 2021 13:09:43 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-11-08T13:09:43Z</dc:date>
    <item>
      <title>multiple case statement not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574007#M200037</link>
      <description>&lt;P&gt;Im working with JSON data and the structure is as per the below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data: { [-]
     application: { [+]
     }
     completedAt: 1636133794444
     environments: [ [-]
       { [-]
         id: XNu1-l8oROOOSM5gpoSR0g
       }
       { [-]
         id: _LY0B7VpRq64tHXq7Uy55A
       }
       { [-]
         id: 7KbvgSBMSUSUyAn2hMXSQA
       }
       { [-]
         id: dJ7EuItjSG2M47-zvIvimQ
       }
     ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when i use a case function for this like the below:&lt;/P&gt;&lt;P&gt;|eval env = case('data.environments{}.id'=="7KbvgSBMSUSUyAn2hMXSQA", "prd-au", 'data.environments{}.id'=="_LY0B7VpRq64tHXq7Uy55A", "prd-gb")&lt;/P&gt;&lt;P&gt;It only ever brings me back 1 result and thats whatever is placed first in the case function so the above returns prd-au and if i swap the values around then it will return prd-gb. I presume this is something to do with how the JSON data is working with splunk causing it to error out but unsure how to resolve?&lt;/P&gt;&lt;P&gt;any ideas?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 12:48:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574007#M200037</guid>
      <dc:creator>samneo</dc:creator>
      <dc:date>2021-11-08T12:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: multiple case statement not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574009#M200038</link>
      <description>&lt;P&gt;Splunk is working with a pipeline of events - the events in the pipeline include multivalue fields such as data.environments{}.id - the eval case finds a match among the multivalues for the first test hence you get the results you are getting&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 13:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574009#M200038</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-08T13:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: multiple case statement not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574010#M200039</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;is there a way round this so i can get all values?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 13:05:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574010#M200039</guid>
      <dc:creator>samneo</dc:creator>
      <dc:date>2021-11-08T13:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: multiple case statement not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574012#M200040</link>
      <description>&lt;P&gt;You would need to expand the event into multiple events, try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mvexapnd 'data.environments{}.id'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 13:09:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-case-statement-not-working/m-p/574012#M200040</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-08T13:09:43Z</dc:date>
    </item>
  </channel>
</rss>

