<?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 with CASE in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42311#M9880</link>
    <description>&lt;P&gt;Are you looking for the word NULL in AV_Version or just blank values?  If you want to use case then you're missing a couple things... this should work..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Severity=case(AV_Version == "NULL", "Informational", AV_Version == "", "Informational")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also look at using the isnull() and if() functions...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Severity=if(isnull(AV_Version),"Informational",AV_Version)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Dec 2011 19:43:27 GMT</pubDate>
    <dc:creator>joshd</dc:creator>
    <dc:date>2011-12-29T19:43:27Z</dc:date>
    <item>
      <title>Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42310#M9879</link>
      <description>&lt;P&gt;How do I assign the value "Informational" to the field Severity when the AV Version contains NULL values byu using the Case:&lt;/P&gt;

&lt;P&gt;Severity= Informational&lt;BR /&gt;
AV Version = NULL&lt;/P&gt;

&lt;P&gt;eval Severity =case (AV_Version = NULL, "Informational") --&amp;gt; this does not work&lt;/P&gt;

&lt;P&gt;PLease advise..  thx&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 19:32:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42310#M9879</guid>
      <dc:creator>efelder0</dc:creator>
      <dc:date>2011-12-29T19:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42311#M9880</link>
      <description>&lt;P&gt;Are you looking for the word NULL in AV_Version or just blank values?  If you want to use case then you're missing a couple things... this should work..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Severity=case(AV_Version == "NULL", "Informational", AV_Version == "", "Informational")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also look at using the isnull() and if() functions...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Severity=if(isnull(AV_Version),"Informational",AV_Version)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2011 19:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42311#M9880</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2011-12-29T19:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42312#M9881</link>
      <description>&lt;P&gt;SOrry, I am looking for blank values. &lt;/P&gt;

&lt;P&gt;So, eval Severity=case (AV_Version == "", "Informational") should work??&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 19:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42312#M9881</guid>
      <dc:creator>efelder0</dc:creator>
      <dc:date>2011-12-29T19:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42313#M9882</link>
      <description>&lt;P&gt;That or you can use the if and isnull combination mentioned ... or you can go as far as to use len() to check the string length, if it's 0 then you know its empty &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 19:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42313#M9882</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2011-12-29T19:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42314#M9883</link>
      <description>&lt;P&gt;Neither of the above mentioned seems to be working..&lt;/P&gt;

&lt;P&gt;DO you have example of the len() command?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 20:24:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42314#M9883</guid>
      <dc:creator>efelder0</dc:creator>
      <dc:date>2011-12-29T20:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42315#M9884</link>
      <description>&lt;P&gt;And you are sure the AV_Version field is being extracted and appears in the events even if it's NULL or blank?  For len you would just do ... | eval Severity=if(len(AV_Version)==0,"Informational",AV_Version)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:15:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42315#M9884</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2020-09-28T10:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42316#M9885</link>
      <description>&lt;P&gt;That field being extracted is blank...&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 20:30:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42316#M9885</guid>
      <dc:creator>efelder0</dc:creator>
      <dc:date>2011-12-29T20:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42317#M9886</link>
      <description>&lt;P&gt;Sorry I dont quite understand... are you confirming the field is being extracted even if it's blank or NULL?  If you do just a regular search for null values it returns events?  for example:  * | where isnull(AV_Version)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 20:36:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42317#M9886</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2011-12-29T20:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42318#M9887</link>
      <description>&lt;P&gt;Here is the actual search string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    sourcetype="McAfee ePo - All" |
    sort DAT_Version__VirusScan_Enterprise_ |
    eval AV_Version=DAT_Version__VirusScan_Enterprise_ |
    eval Version_Diff=Current_DAT_Version- 
    DAT_Version__VirusScan_Enterprise_ |
    eval Severity =case(
    DAT_Version__VirusScan_Enterprise_ = 0, "Informational",        
    DAT_Version__VirusScan_Enterprise_ == "", "Informational",
    Version_Diff &amp;gt;= 0 AND Version_Diff &amp;lt;= 5, "Low",
    Version_Diff &amp;gt; 5 AND Version_Diff &amp;lt;= 10, "Medium",
    Version_Diff &amp;gt; 10, "High",
    DAT_Version__VirusScan_Enterprise_ = "N/A", "Informational") |
    table System_Name Last_Communication Current_DAT_Version AV_Version Severity Engine_Version__VirusScan_Enterprise_ 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2011 20:40:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42318#M9887</guid>
      <dc:creator>efelder0</dc:creator>
      <dc:date>2011-12-29T20:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42319#M9888</link>
      <description>&lt;P&gt;Can you edit your post, highlight the search string you have above and click the code button on the menu bar so that it pastes properly and does not apply automatic formatting.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 20:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42319#M9888</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2011-12-29T20:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with CASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42320#M9889</link>
      <description>&lt;P&gt;hmm, best effort at making it more readable&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2011 20:48:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-CASE/m-p/42320#M9889</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2011-12-29T20:48:12Z</dc:date>
    </item>
  </channel>
</rss>

