<?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: How to pass multiple fields in Case or IF commands in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/698251#M237127</link>
    <description>&lt;P&gt;If I must guess, the use of wildcard characters make your search not returning your desired results? (Syntax-wise, I am not sure if IN operator can use square brackets.) &amp;nbsp;As you only illustrated two values, no need to use case.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval severity_id=if(Private_MBytes &amp;gt;= 20000 AND searchmatch("host IN (vmd*,vmt*,vmu*)") OR Private_MBytes &amp;gt;= 40000 AND host LIKE "vmp%", 4, 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2024 03:38:03 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2024-09-05T03:38:03Z</dc:date>
    <item>
      <title>How to pass multiple fields in Case or IF commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/698250#M237126</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I have some events with the field&amp;nbsp;Private_MBytes and host = vmt/vmu/vmd/vmp&lt;/P&gt;
&lt;P&gt;I want to create a case when host is either vmt/vmu/vmd and&amp;nbsp;Private_MBytes&amp;nbsp; &amp;gt; 20000 OR when host is vmp and&amp;nbsp;&amp;nbsp;Private_MBytes &amp;gt; 40000 then it should display the events with severity_id 4. Example&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;eval severity_id=if(Private_MBytes &amp;gt;= "20000" AND host IN [vmd*,vmt*,vmu*],4,2)

eval severity_id=if(Private_MBytes &amp;gt;= "40000" AND host ==vmp*,4,2)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note :&amp;nbsp; if&amp;nbsp;Private_MBytes &amp;gt; 40000, and then if there is any vmd/vmu/vmt it should display severity_id 4 only and for vmp also.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 14:11:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/698250#M237126</guid>
      <dc:creator>devsru</dc:creator>
      <dc:date>2024-09-05T14:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple fields in Case or IF commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/698251#M237127</link>
      <description>&lt;P&gt;If I must guess, the use of wildcard characters make your search not returning your desired results? (Syntax-wise, I am not sure if IN operator can use square brackets.) &amp;nbsp;As you only illustrated two values, no need to use case.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval severity_id=if(Private_MBytes &amp;gt;= 20000 AND searchmatch("host IN (vmd*,vmt*,vmu*)") OR Private_MBytes &amp;gt;= 40000 AND host LIKE "vmp%", 4, 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 03:38:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/698251#M237127</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-09-05T03:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple fields in Case or IF commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/698257#M237128</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259358"&gt;@devsru&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to correlate your conditions using the boolean operators AND and OR and the parenthesys, aligned with the logic you need:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval severity_id=if((Private_MBytes&amp;gt;=20000 AND host IN ("vmd*","vmt*","vmu*")) OR (Private_MBytes&amp;gt;=40000 AND host="vmp*"), 4, 2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 06:43:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/698257#M237128</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-05T06:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple fields in Case or IF commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/699929#M237566</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259358"&gt;@devsru&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 12:09:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-fields-in-Case-or-IF-commands/m-p/699929#M237566</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-24T12:09:06Z</dc:date>
    </item>
  </channel>
</rss>

