<?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: Help in using CASE Statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-in-using-CASE-Statement/m-p/507373#M141865</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval filter=split("3G Outage,Cell Blocked,Power Outage",",")
| rename COMMENT as "this is sample"
| rename COMMENT as "the logic"
| eval impact=case(match(filter,"3G Outage"),"Full Outage",match(filter,"Cell Blocked"),"Partial Outage",1=1,"No service impact")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;filter&amp;nbsp;&lt;/STRONG&gt;is multivalue ,&lt;STRONG&gt;searchmatch()&amp;nbsp;&lt;/STRONG&gt;works only &lt;STRONG&gt;_raw&amp;nbsp;&lt;/STRONG&gt;and &lt;STRONG&gt;case() &lt;/STRONG&gt;works in order.&lt;BR /&gt;How about this?&lt;/P&gt;</description>
    <pubDate>Sat, 04 Jul 2020 22:46:14 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-07-04T22:46:14Z</dc:date>
    <item>
      <title>Help in using CASE Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-in-using-CASE-Statement/m-p/507370#M141863</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I want to group the filter into Full Outage or Partial Outage.&lt;/P&gt;&lt;TABLE width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="96px"&gt;&lt;STRONG&gt;filter&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="95px"&gt;&lt;STRONG&gt;&amp;nbsp;impact&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96px"&gt;&lt;P&gt;3G Outage&lt;/P&gt;&lt;/TD&gt;&lt;TD width="95px"&gt;Full Outage&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96px"&gt;&lt;P&gt;Cell Blocked&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96px"&gt;&lt;P&gt;Power Outage&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96px"&gt;Power Outage&lt;/TD&gt;&lt;TD width="95px"&gt;Partial Outage&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96px"&gt;&lt;P&gt;Cell Blocked&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my query:&lt;/P&gt;&lt;P&gt;| eval impact=case(&lt;BR /&gt;searchmatch("Cell Blocked"),"Partial Outage",&lt;BR /&gt;searchmatch("3G Outage"),"Full Outage",1=1,"No service impact")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result.PNG" style="width: 295px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9469iBB1350F08972621E/image-size/large?v=v2&amp;amp;px=999" role="button" title="result.PNG" alt="result.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correct impact should be Full Outage. Can anyone help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jul 2020 20:57:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-in-using-CASE-Statement/m-p/507370#M141863</guid>
      <dc:creator>Noob_splunker</dc:creator>
      <dc:date>2020-07-04T20:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help in using CASE Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-in-using-CASE-Statement/m-p/507373#M141865</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval filter=split("3G Outage,Cell Blocked,Power Outage",",")
| rename COMMENT as "this is sample"
| rename COMMENT as "the logic"
| eval impact=case(match(filter,"3G Outage"),"Full Outage",match(filter,"Cell Blocked"),"Partial Outage",1=1,"No service impact")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;filter&amp;nbsp;&lt;/STRONG&gt;is multivalue ,&lt;STRONG&gt;searchmatch()&amp;nbsp;&lt;/STRONG&gt;works only &lt;STRONG&gt;_raw&amp;nbsp;&lt;/STRONG&gt;and &lt;STRONG&gt;case() &lt;/STRONG&gt;works in order.&lt;BR /&gt;How about this?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jul 2020 22:46:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-in-using-CASE-Statement/m-p/507373#M141865</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-04T22:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help in using CASE Statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-in-using-CASE-Statement/m-p/507375#M141866</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;awesome!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| eval impact=case(match(filter,"3G Outage"),"Full Outage",match(filter,"Cell Blocked"),"Partial Outage",1=1,"No service impact")&lt;/PRE&gt;&lt;P&gt;this works fine for me! Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jul 2020 22:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-in-using-CASE-Statement/m-p/507375#M141866</guid>
      <dc:creator>Noob_splunker</dc:creator>
      <dc:date>2020-07-04T22:57:51Z</dc:date>
    </item>
  </channel>
</rss>

