<?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: if else with where clause in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415160#M119533</link>
    <description>&lt;P&gt;thank you vnravikumar, it worked &lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2019 13:03:23 GMT</pubDate>
    <dc:creator>dkdeepshikhaa</dc:creator>
    <dc:date>2019-06-07T13:03:23Z</dc:date>
    <item>
      <title>if else with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415157#M119530</link>
      <description>&lt;P&gt;required&lt;/P&gt;

&lt;P&gt;if (a $lt; b)&lt;/P&gt;

&lt;P&gt;eval c=round(((b-a)/b)*100),0)&lt;BR /&gt;
print c&lt;BR /&gt;
else &lt;BR /&gt;
print "no change"&lt;/P&gt;

&lt;P&gt;How to get this through splunk query?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 07:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415157#M119530</guid>
      <dc:creator>dkdeepshikhaa</dc:creator>
      <dc:date>2019-06-07T07:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: if else with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415158#M119531</link>
      <description>&lt;P&gt;@dkdeepshikhaa &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval a=100,b=20,c="No Change"
| eval c=case(a&amp;lt;b,round(((b-a)/b)*100,0),1=1,c)


| makeresults 
| eval a=100,b=200,c="No Change"
| eval c=case(a&amp;lt;b,round(((b-a)/b)*100,0),1=1,c)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jun 2019 11:43:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415158#M119531</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-06-07T11:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: if else with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415159#M119532</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval a=20,b=30 
| eval c=if(a&amp;lt;b,round(((b-a)/b)*100,0),"no change")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jun 2019 11:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415159#M119532</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-06-07T11:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: if else with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415160#M119533</link>
      <description>&lt;P&gt;thank you vnravikumar, it worked &lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 13:03:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/if-else-with-where-clause/m-p/415160#M119533</guid>
      <dc:creator>dkdeepshikhaa</dc:creator>
      <dc:date>2019-06-07T13:03:23Z</dc:date>
    </item>
  </channel>
</rss>

