<?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 do a nested if statement? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-do-a-nested-if-statement/m-p/427379#M7621</link>
    <description>&lt;P&gt;Use this code , as you need to specify the value if FCP!=0 condition is false therefore I have placed null( can be any other value like " ")&lt;/P&gt;

&lt;P&gt;|eval test=if(TTI &amp;gt; 0, TTI,if(FCP!=0,TTIVR,null))&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2018 14:43:48 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2018-10-16T14:43:48Z</dc:date>
    <item>
      <title>How do I do a nested if statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-do-a-nested-if-statement/m-p/427378#M7620</link>
      <description>&lt;P&gt;I am trying to use multiple ifs within the eval but the query seems to throw an error. &lt;/P&gt;

&lt;P&gt;What i want to do is use TTI if it's greater than 0. Otherwise, I'd use TTIVR if FCP!=0&lt;/P&gt;

&lt;P&gt;This is what i tried so far&lt;BR /&gt;
 | eval test=if( TTI &amp;gt; 0, TTI, if(FCP!=0,TTIVR))&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 14:14:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-do-a-nested-if-statement/m-p/427378#M7620</guid>
      <dc:creator>jitin_ratra</dc:creator>
      <dc:date>2018-10-16T14:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do a nested if statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-do-a-nested-if-statement/m-p/427379#M7621</link>
      <description>&lt;P&gt;Use this code , as you need to specify the value if FCP!=0 condition is false therefore I have placed null( can be any other value like " ")&lt;/P&gt;

&lt;P&gt;|eval test=if(TTI &amp;gt; 0, TTI,if(FCP!=0,TTIVR,null))&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 14:43:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-do-a-nested-if-statement/m-p/427379#M7621</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-10-16T14:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do a nested if statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-do-a-nested-if-statement/m-p/427380#M7622</link>
      <description>&lt;P&gt;@jitin_ratra&lt;/P&gt;

&lt;P&gt;You can try &lt;CODE&gt;case&lt;/CODE&gt; also.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH
| eval test=case( TTI&amp;gt;0, TTI, FCP!=0,TTIVR)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval TTI=100,FCP=0,TTIVR =100
| eval test=case( TTI&amp;gt;0, TTI, FCP!=0,TTIVR)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/ConditionalFunctions#case.28X.2C.22Y.22.2C....29"&gt;http://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/ConditionalFunctions#case.28X.2C.22Y.22.2C....29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 16:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-do-a-nested-if-statement/m-p/427380#M7622</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-10-16T16:09:56Z</dc:date>
    </item>
  </channel>
</rss>

