<?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 If/Then To different Eval Statements in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135139#M36932</link>
    <description>&lt;P&gt;I'm trying to have a Splunk Alert kick off an email (to an email script) and depending on the search query it should email Address1 or Address2. How do you I create this type of variable? Should I setup a where statement like | where search=Apples | eval email="address1" |where search=Oranges | eval email="address2" ????&lt;/P&gt;

&lt;P&gt;Example:   &lt;/P&gt;

&lt;P&gt;[search yields Apples] | eval email="address1"&lt;/P&gt;

&lt;P&gt;[search yields Oranges] | eval email="address2"&lt;/P&gt;</description>
    <pubDate>Mon, 22 Sep 2014 14:02:19 GMT</pubDate>
    <dc:creator>albyva</dc:creator>
    <dc:date>2014-09-22T14:02:19Z</dc:date>
    <item>
      <title>If/Then To different Eval Statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135139#M36932</link>
      <description>&lt;P&gt;I'm trying to have a Splunk Alert kick off an email (to an email script) and depending on the search query it should email Address1 or Address2. How do you I create this type of variable? Should I setup a where statement like | where search=Apples | eval email="address1" |where search=Oranges | eval email="address2" ????&lt;/P&gt;

&lt;P&gt;Example:   &lt;/P&gt;

&lt;P&gt;[search yields Apples] | eval email="address1"&lt;/P&gt;

&lt;P&gt;[search yields Oranges] | eval email="address2"&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2014 14:02:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135139#M36932</guid>
      <dc:creator>albyva</dc:creator>
      <dc:date>2014-09-22T14:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then To different Eval Statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135140#M36933</link>
      <description>&lt;P&gt;You can club if and eval as below.&lt;/P&gt;

&lt;PRE&gt;
eval email=if(mycondition,"address1","address2")
&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Sep 2014 14:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135140#M36933</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2014-09-22T14:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then To different Eval Statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135141#M36934</link>
      <description>&lt;P&gt;Can you add a wildcard into mycondition?&lt;/P&gt;

&lt;P&gt;I see where if(X,Y,Z) says:  This function takes three arguments. The first argument X is a Boolean expression. If X evaluates to TRUE, the result is the second argument Y. Optionally, if X evaluates to FALSE, the result evaluates to the third argument Z. &lt;/P&gt;

&lt;P&gt;My problem now is that (X) is something like 123.45 Gbps or 45.67 Mbps.   My goal is to have  Gbps send email to address1 and everything go to address2.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;| eval email=if(BPS="Gbps","address1","address2") &lt;/P&gt;

&lt;P&gt;The problem appears to be that if I say Gbps or even *Gbps in the X field, neither seem to work. It's only when I specify the exact value like 123.45 Gbps does it actually work. So what I need is a wildcard, but that isn't working. Any suggestions??? &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135141#M36934</guid>
      <dc:creator>albyva</dc:creator>
      <dc:date>2014-09-22T15:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then To different Eval Statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135142#M36935</link>
      <description>&lt;P&gt;Yes, you should be able to do it.. You can also try to extract just Gbps and Mbps into a field before the condition and try the comparison on that field.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135142#M36935</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2014-09-22T15:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then To different Eval Statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135143#M36936</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval email=if(like(BPS,"%Gbps"),"address1","address2") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135143#M36936</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-09-22T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then To different Eval Statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135144#M36937</link>
      <description>&lt;P&gt;Thank You !!!!  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:29:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-Then-To-different-Eval-Statements/m-p/135144#M36937</guid>
      <dc:creator>albyva</dc:creator>
      <dc:date>2014-09-22T15:29:31Z</dc:date>
    </item>
  </channel>
</rss>

