<?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 How to edit my eval syntax to check if the value &amp;quot;No results found.&amp;quot; exists? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258265#M77365</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;|eval final = if(running_ok==" " OR running_ok==1,1,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to assign final=1 when (running_ok=="No results found." OR running_ok==1).&lt;/P&gt;

&lt;P&gt;Running_ok==1 works fine, but it does not work when running_ok=="No results found."&lt;BR /&gt;
Please let me know what needs to be used on the RHS when search returns no values.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 12:00:24 GMT</pubDate>
    <dc:creator>email2vamsi</dc:creator>
    <dc:date>2020-09-29T12:00:24Z</dc:date>
    <item>
      <title>How to edit my eval syntax to check if the value "No results found." exists?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258265#M77365</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|eval final = if(running_ok==" " OR running_ok==1,1,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to assign final=1 when (running_ok=="No results found." OR running_ok==1).&lt;/P&gt;

&lt;P&gt;Running_ok==1 works fine, but it does not work when running_ok=="No results found."&lt;BR /&gt;
Please let me know what needs to be used on the RHS when search returns no values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258265#M77365</guid>
      <dc:creator>email2vamsi</dc:creator>
      <dc:date>2020-09-29T12:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my eval syntax to check if the value "No results found." exists?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258266#M77366</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | eval final=if(match(running_ok, "No results") OR running_ok=1, 1, 0) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:41:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258266#M77366</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-30T12:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my eval syntax to check if the value "No results found." exists?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258267#M77367</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval final = if(isnull(running_ok) OR running_ok==1,1,0)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258267#M77367</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-11-30T12:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my eval syntax to check if the value "No results found." exists?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258268#M77368</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="Index1" sourcetype="response" | eval running_ok = if(response_status="Running","0","1") |head 1
|join running_ok
[search index="Index1" sourcetype="monitor" | eval running_ok = if(monitor_status="Running","0","1")|head 1] 
|eval final = if(running_ok==0,0,1)
|eval final = if(running_ok==" " OR running_ok==1,1,0) |table final | outputlookup output.csv 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using join on two sourcetypes for the field "running_ok".&lt;BR /&gt;
The following table is derived based on how the inner join functions.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(Main search "running_ok" result),(Sub search "running_ok" result)= 0 or 1 or Blank(Join Search returned no values.)
0,0=0 (Running)
1,0= blank (Not Running)
0,1= blank (Not Running)
1,1=1 (Not Running)

|eval final = if(running_ok==0,0,1)
|eval final = if(running_ok=="Join search returns no values." OR running_ok==1,1,0) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From the above i am able to assign required value for "final" when running_ok=0 or 1. &lt;BR /&gt;
But I could not assign value for "final" when "Join search returns no values."&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 11:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258268#M77368</guid>
      <dc:creator>email2vamsi</dc:creator>
      <dc:date>2016-12-01T11:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my eval syntax to check if the value "No results found." exists?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258269#M77369</link>
      <description>&lt;P&gt;One has to force a search to return a response when there are no events that match.  The appendpipe command is often used for that.  Try this updated query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="Index1" sourcetype="response" | eval running_ok = if(response_status="Running","0","1") |head 1
|join running_ok
[search index="Index1" sourcetype="monitor" | appendpipe [ stats count | eval monitor_status="Not running" | where count==0 | fields - count ] | eval running_ok = if(monitor_status="Running","0","1")|head 1] 
|eval final = if(running_ok==0,0,1)
|eval final = if(running_ok==" " OR running_ok==1,1,0) |table final | outputlookup output.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2016 13:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-eval-syntax-to-check-if-the-value-quot-No-results/m-p/258269#M77369</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-12-01T13:17:43Z</dc:date>
    </item>
  </channel>
</rss>

