<?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: Eval subsearch give error when result not found in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-subsearch-give-error-when-result-not-found/m-p/439780#M191174</link>
    <description>&lt;P&gt;You're a legend mate.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2019 03:07:07 GMT</pubDate>
    <dc:creator>salt87</dc:creator>
    <dc:date>2019-08-08T03:07:07Z</dc:date>
    <item>
      <title>Eval subsearch give error when result not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-subsearch-give-error-when-result-not-found/m-p/439778#M191172</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;my search is the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup genesis.csv

| eval _time=now()
| eval field1=[ | inputlookup lookup.csv
| search Field1=value
| stats count by Field1| return $count]

| outputlookup blabla.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works when the subsearch returns a value, however it gives me an error when the subsearch return "No Result Found"&lt;/P&gt;

&lt;P&gt;Is there something I can do to replace the error by the value "0"&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 01:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-subsearch-give-error-when-result-not-found/m-p/439778#M191172</guid>
      <dc:creator>salt87</dc:creator>
      <dc:date>2019-08-08T01:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Eval subsearch give error when result not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-subsearch-give-error-when-result-not-found/m-p/439779#M191173</link>
      <description>&lt;P&gt;Hi salt87,&lt;/P&gt;

&lt;P&gt;give this a try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval field1=[ | inputlookup lookup.csv
| search Field1=value
| stats count by Field1
| appendpipe 
    [| stats count 
    | where count=0]| return $count]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;all this does is it will return something even you have no match. In the case of no match it will have &lt;CODE&gt;count = 0&lt;/CODE&gt; as result.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 02:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-subsearch-give-error-when-result-not-found/m-p/439779#M191173</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-08-08T02:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Eval subsearch give error when result not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-subsearch-give-error-when-result-not-found/m-p/439780#M191174</link>
      <description>&lt;P&gt;You're a legend mate.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 03:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-subsearch-give-error-when-result-not-found/m-p/439780#M191174</guid>
      <dc:creator>salt87</dc:creator>
      <dc:date>2019-08-08T03:07:07Z</dc:date>
    </item>
  </channel>
</rss>

