<?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: Search inside Eval if statement possible ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90383#M23232</link>
    <description>&lt;P&gt;The first point, is that the if statement only takes 3 arguments, if(condition, iftrue, iffalse).  &lt;/P&gt;</description>
    <pubDate>Mon, 23 Feb 2015 14:09:55 GMT</pubDate>
    <dc:creator>markthompson</dc:creator>
    <dc:date>2015-02-23T14:09:55Z</dc:date>
    <item>
      <title>Search inside Eval if statement possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90381#M23230</link>
      <description>&lt;P&gt;Is it possible to put search inside an eval if statement ? I am making a search that if the count of the field is greater than 1 it would display "Please check your query" then if its  equal to 1 it will proceed to my search.. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval test=if(count&amp;gt;1,"Please check query",count==1,*search command goes here*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is the eval if statement the thing to use ? &lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2013 08:10:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90381#M23230</guid>
      <dc:creator>crt89</dc:creator>
      <dc:date>2013-01-17T08:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Search inside Eval if statement possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90382#M23231</link>
      <description>&lt;P&gt;Can you please give more details?  It would help to know the rest of your search string and what search command you want to append to it, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2013 14:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90382#M23231</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2013-01-17T14:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Search inside Eval if statement possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90383#M23232</link>
      <description>&lt;P&gt;The first point, is that the if statement only takes 3 arguments, if(condition, iftrue, iffalse).  &lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2015 14:09:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90383#M23232</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-23T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Search inside Eval if statement possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90384#M23233</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can try using &lt;STRONG&gt;join&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;The query can have following logic:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval test=if(count&amp;gt;1,"Please check query","JOIN_SEARCH") | join test [your custom search | eval test="JOIN_SEARCH"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note, the additional variable "test" in subsearch is required to join the record with first search. So, for all the events where the condition ( count &amp;gt; 1 ) fails, test variable in first search will get value of "JOIN_SEARCH".&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2015 11:46:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-inside-Eval-if-statement-possible/m-p/90384#M23233</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-04-09T11:46:02Z</dc:date>
    </item>
  </channel>
</rss>

