<?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 to show zero when no results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68424#M17144</link>
    <description>&lt;P&gt;Hmm it looks like this only works, if your search returns at least one event....&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2013 15:37:13 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2013-06-19T15:37:13Z</dc:date>
    <item>
      <title>Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68419#M17139</link>
      <description>&lt;P&gt;I have the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=@d+11h latest=@d+22h index="daluat" Action="DAL*" | timechart span=30m count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At the moment there are no results. And I get the "No results..." message. &lt;BR /&gt;
But I want to see a 0 for every 30-minute timespan between 1100 and 2200. &lt;BR /&gt;
How do I do this?&lt;/P&gt;

&lt;P&gt;If there was a single result I get the full table- but if there were results then an alert would not trigger.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Matt&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 10:43:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68419#M17139</guid>
      <dc:creator>matthewcanty</dc:creator>
      <dc:date>2013-06-19T10:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68420#M17140</link>
      <description>&lt;P&gt;Hi matthewcanty&lt;/P&gt;

&lt;P&gt;you can use fillnull on your search and you will get 0 for every empty field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fillnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;read more here &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Fillnull"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Fillnull&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 13:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68420#M17140</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-06-19T13:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68421#M17141</link>
      <description>&lt;P&gt;MuS you beat me to it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 13:04:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68421#M17141</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2013-06-19T13:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68422#M17142</link>
      <description>&lt;P&gt;out luck /K was not around, he would have answered this loooong before us &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 13:16:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68422#M17142</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-06-19T13:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68423#M17143</link>
      <description>&lt;P&gt;Doesn't work anyway guys.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 13:31:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68423#M17143</guid>
      <dc:creator>matthewcanty</dc:creator>
      <dc:date>2013-06-19T13:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68424#M17144</link>
      <description>&lt;P&gt;Hmm it looks like this only works, if your search returns at least one event....&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 15:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68424#M17144</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-06-19T15:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68425#M17145</link>
      <description>&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/118496/fill-in-0-for-timechart-with-missing-values"&gt;http://answers.splunk.com/answers/118496/fill-in-0-for-timechart-with-missing-values&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2014 18:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68425#M17145</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2014-02-13T18:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68426#M17146</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;earliest=@d+11h latest=@d+22h index="daluat" Action="DAL*" | append [| search | fields - * | eval count=0] | timechart span=30m count&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 02:54:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68426#M17146</guid>
      <dc:creator>splunk_kk</dc:creator>
      <dc:date>2017-06-16T02:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68427#M17147</link>
      <description>&lt;P&gt;Yes, same thing is happening on my side. Fillnull is made for returning value for null attributes but the condition is to have at least a row of results. When there are no results at all, there is no fillnull working in that condition.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 15:30:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68427#M17147</guid>
      <dc:creator>harry2007gsp</dc:creator>
      <dc:date>2019-06-17T15:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search to show zero when no results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68428#M17148</link>
      <description>&lt;P&gt;Greetings from the future,&lt;/P&gt;

&lt;P&gt;you can run a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| stats count by sourcetype 
| append 
    [| stats count 
    | eval sourcetype=if(isnull(sourcetype), "Nothing to see here, move along!", sourcetype)] 
| streamstats count AS line_num 
| eval head_num=if(line_num &amp;gt; 1, line_num - 1, 1) | where NOT ( count=0 AND head_num &amp;lt; line_num ) | table sourcetype count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 19:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-show-zero-when-no-results/m-p/68428#M17148</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-06-18T19:05:22Z</dc:date>
    </item>
  </channel>
</rss>

