<?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 do I edit my if else case eval statement to match my requirement? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211428#M61865</link>
    <description>&lt;P&gt;Thanks for this last example. This is what I was looking for in a separate search. &lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2017 16:20:42 GMT</pubDate>
    <dc:creator>lisaac</dc:creator>
    <dc:date>2017-01-20T16:20:42Z</dc:date>
    <item>
      <title>How do I edit my if else case eval statement to match my requirement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211424#M61861</link>
      <description>&lt;P&gt;How can I case eval this so that:&lt;/P&gt;

&lt;P&gt;if Logon_VM is 202-VM-MS, then MICROSOFT &lt;BR /&gt;
OR &lt;BR /&gt;
if Logon_VM is 202-VM-BOB, then BOB'S WAFFLES &lt;BR /&gt;
ELSE&lt;BR /&gt;
all the rest will be TEST COMPANY.  &lt;/P&gt;

&lt;P&gt;This all works up until else the rest are TEST COMPANY.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Company = case(Logon_VM == "202-VM-MS","MICROSOFT",Logon_VM == "202-VM-BOB","BOB'S WAFFLES",Logon_VM == "B0-202-VM-*","TEST COMPANY")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211424#M61861</guid>
      <dc:creator>rfiscus</dc:creator>
      <dc:date>2020-09-29T07:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my if else case eval statement to match my requirement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211425#M61862</link>
      <description>&lt;P&gt;I found the answer here, just add any true statement like 1=1, "TEST COMPANY" in the eval statement.&lt;/P&gt;

&lt;P&gt;So:  &lt;CODE&gt;eval Company = case(Logon_VM == "202-VM-MS","MICROSOFT",Logon_VM == "202-VM-BOB","BOB'S WAFFLES",1=1,"TEST COMPANY")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 18:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211425#M61862</guid>
      <dc:creator>rfiscus</dc:creator>
      <dc:date>2015-11-02T18:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my if else case eval statement to match my requirement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211426#M61863</link>
      <description>&lt;P&gt;Case uses an if x, then y pattern, and will default to "NULL" if there is no match. You can change the default value by making the last pairing default to true.&lt;/P&gt;

&lt;P&gt;Try this: &lt;BR /&gt;
eval Company = case(Logon_VM == "202-VM-MS","MICROSOFT",Logon_VM == "202-VM-BOB","BOB'S WAFFLES", 1=1,"TEST COMPANY")&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211426#M61863</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2020-09-29T07:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my if else case eval statement to match my requirement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211427#M61864</link>
      <description>&lt;P&gt;Found it from Ayn on &lt;A href="https://answers.splunk.com/answers/26522/if-statment-or-nested-if.html"&gt;https://answers.splunk.com/answers/26522/if-statment-or-nested-if.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 18:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211427#M61864</guid>
      <dc:creator>rfiscus</dc:creator>
      <dc:date>2015-11-02T18:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my if else case eval statement to match my requirement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211428#M61865</link>
      <description>&lt;P&gt;Thanks for this last example. This is what I was looking for in a separate search. &lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 16:20:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211428#M61865</guid>
      <dc:creator>lisaac</dc:creator>
      <dc:date>2017-01-20T16:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my if else case eval statement to match my requirement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211429#M61866</link>
      <description>&lt;P&gt;1) splunk provides a True() function, which you should use in place of the 1=1.&lt;BR /&gt;
2) I believe that should be 1==1.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 19:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211429#M61866</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-01-20T19:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my if else case eval statement to match my requirement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211430#M61867</link>
      <description>&lt;P&gt;1) splunk provides a True() function, which you should use in place of the 1=1.&lt;BR /&gt;
2) I believe that should be 1==1.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 19:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-if-else-case-eval-statement-to-match-my/m-p/211430#M61867</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-01-20T19:58:01Z</dc:date>
    </item>
  </channel>
</rss>

