<?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 Splunk subsearch noresult in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-subsearch-noresult/m-p/119361#M32016</link>
    <description>&lt;P&gt;Am trying to run a query where subsearch might return no results on some days. In such case i am trying to assign 0 values to calculate ratio, but its not returning any results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype="abc" 
| eval date=strftime(_time, "%x") 
| stats dc(uuid) as countA by date   
| join _time  [ search index=main sourcetype="abc" | eval date=strftime(_time, "%x") | search "error" | stats dc(uuid) as countB by date]
| eval Ratio=(countA/(countA+countB)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried appending fillnull at the end of subsearch but it returns noresults.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2014 09:27:33 GMT</pubDate>
    <dc:creator>pdash</dc:creator>
    <dc:date>2014-01-20T09:27:33Z</dc:date>
    <item>
      <title>Splunk subsearch noresult</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-subsearch-noresult/m-p/119361#M32016</link>
      <description>&lt;P&gt;Am trying to run a query where subsearch might return no results on some days. In such case i am trying to assign 0 values to calculate ratio, but its not returning any results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype="abc" 
| eval date=strftime(_time, "%x") 
| stats dc(uuid) as countA by date   
| join _time  [ search index=main sourcetype="abc" | eval date=strftime(_time, "%x") | search "error" | stats dc(uuid) as countB by date]
| eval Ratio=(countA/(countA+countB)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried appending fillnull at the end of subsearch but it returns noresults.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2014 09:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-subsearch-noresult/m-p/119361#M32016</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2014-01-20T09:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk subsearch noresult</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-subsearch-noresult/m-p/119362#M32017</link>
      <description>&lt;P&gt;got it:&lt;/P&gt;

&lt;P&gt;index=main sourcetype="abc" &lt;BR /&gt;
| eval date=strftime(_time, "%x") &lt;BR /&gt;
| stats dc(uuid) as countA by date&lt;BR /&gt;&lt;BR /&gt;
| join _time  [ search index=main sourcetype="abc" | eval date=strftime(_time, "%x") | search "error" | stats dc(uuid) as countB by date | appendpipe [ stats count | eval countB=0 | where count==0 | fields - count ] ]&lt;BR /&gt;
| eval Ratio=(countA/(countA+countB))&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-subsearch-noresult/m-p/119362#M32017</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2020-09-28T15:41:11Z</dc:date>
    </item>
  </channel>
</rss>

