<?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 conditional statements for search?? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104922#M27200</link>
    <description>&lt;P&gt;how to do that?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jan 2013 15:32:22 GMT</pubDate>
    <dc:creator>Splunk_U</dc:creator>
    <dc:date>2013-01-09T15:32:22Z</dc:date>
    <item>
      <title>If/else conditional statements for search??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104918#M27196</link>
      <description>&lt;P&gt;Is it possible to have an if else conditional statement in search? I'm creating a form with a drop-down list and depending on which option the user chooses, the results are calculated differently. I need something that will do &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if $eventtype$="event1" then, calculate completion rate this way,

else, calculate completion rate another way
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can this be done? I have a form and this search will be in a &lt;SEARCHTEMPLATE&gt;&lt;/SEARCHTEMPLATE&gt;&lt;/P&gt;

&lt;P&gt;~Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2012 21:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104918#M27196</guid>
      <dc:creator>monicato</dc:creator>
      <dc:date>2012-07-20T21:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: If/else conditional statements for search??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104919#M27197</link>
      <description>&lt;P&gt;What does your whole search look like, and how are you calculating things? Splunk has the &lt;CODE&gt;eval&lt;/CODE&gt; command which either can be used by itself (&lt;CODE&gt;| eval foo=if(eventtype="event1",somecalculation,someothercalculation)&lt;/CODE&gt;) or as part of some kind of &lt;CODE&gt;stats&lt;/CODE&gt; command (&lt;CODE&gt;| stats count(eval(someevalcondition))&lt;/CODE&gt; for instance, replace with whatever statistical function you want). There's also &lt;CODE&gt;case&lt;/CODE&gt; which lets you specify an arbitrary number of options rather than just the &lt;CODE&gt;if&lt;/CODE&gt; statements 2 (either eventtype is this, or it isn't).&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2012 21:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104919#M27197</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-07-20T21:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: If/else conditional statements for search??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104920#M27198</link>
      <description>&lt;P&gt;ah thanks! I was looking for the if statement format! Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2012 21:51:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104920#M27198</guid>
      <dc:creator>monicato</dc:creator>
      <dc:date>2012-07-20T21:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: If/else conditional statements for search??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104921#M27199</link>
      <description>&lt;P&gt;You can try conditionalswitcher modules to switch your modules or searches on basis of user input.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2012 09:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104921#M27199</guid>
      <dc:creator>john</dc:creator>
      <dc:date>2012-10-09T09:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: If/else conditional statements for search??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104922#M27200</link>
      <description>&lt;P&gt;how to do that?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 15:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-else-conditional-statements-for-search/m-p/104922#M27200</guid>
      <dc:creator>Splunk_U</dc:creator>
      <dc:date>2013-01-09T15:32:22Z</dc:date>
    </item>
  </channel>
</rss>

