<?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: How to write a search to create a summary index with a count of &amp;quot;0&amp;quot; when there are no events matching &amp;quot;myerror&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274360#M82760</link>
    <description>&lt;P&gt;Thanks but that didn't do it. I don't get data when I have no events.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2016 05:59:12 GMT</pubDate>
    <dc:creator>burwell</dc:creator>
    <dc:date>2016-10-27T05:59:12Z</dc:date>
    <item>
      <title>How to write a search to create a summary index with a count of "0" when there are no events matching "myerror"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274358#M82758</link>
      <description>&lt;P&gt;I have a search to create a summary index which runs every 15 minutes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=foo "myerror" | bin span=15m _time |  sistats count by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to have 0 in my summary search when there are no events matching "myerror".&lt;/P&gt;

&lt;P&gt;How do I do that?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 02:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274358#M82758</guid>
      <dc:creator>burwell</dc:creator>
      <dc:date>2016-10-27T02:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to create a summary index with a count of "0" when there are no events matching "myerror"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274359#M82759</link>
      <description>&lt;P&gt;See if this works: Change it from sistats to stats and use the collect command..,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | stats count by _time | collect index=summary 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 02:38:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274359#M82759</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-10-27T02:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to create a summary index with a count of "0" when there are no events matching "myerror"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274360#M82760</link>
      <description>&lt;P&gt;Thanks but that didn't do it. I don't get data when I have no events.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 05:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274360#M82760</guid>
      <dc:creator>burwell</dc:creator>
      <dc:date>2016-10-27T05:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to create a summary index with a count of "0" when there are no events matching "myerror"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274361#M82761</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=foo "myerror" | bin span=15m _time |  sistats count by _time | appendpipe [| stats count | where count=0 | addinfo  | eval _time=info_min_time| bucket span=15m _time | table _time count | sistats count by _time ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 16:16:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274361#M82761</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-27T16:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to create a summary index with a count of "0" when there are no events matching "myerror"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274362#M82762</link>
      <description>&lt;P&gt;I tried this (I am getting rid of the bin span)... this works except when there are no errors then it says 1 instead of 0.&lt;/P&gt;

&lt;P&gt;I tried adding eval count=count-1 in the appendpipe clause but could not get this to give me zero.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo "myerror" | sistats count |appendpipe [| stats count | where count=0 | addinfo  | eval _time=info_min_time|  table _time count |  sistats count    ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Oct 2016 02:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-create-a-summary-index-with-a-count-of/m-p/274362#M82762</guid>
      <dc:creator>burwell</dc:creator>
      <dc:date>2016-10-30T02:33:09Z</dc:date>
    </item>
  </channel>
</rss>

