<?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 Show all buckets of _time in visualization including zero counts in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Show-all-buckets-of-time-in-visualization-including-zero-counts/m-p/318302#M59480</link>
    <description>&lt;P&gt;Hello Splunker,&lt;/P&gt;

&lt;P&gt;I'm trying to display a 'timestamp, event count' visualization including counts of zero events&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;host="[redacted]" src_port=* | bucket _time span=1h | stats count by _time | eval _time=strftime(_time, "%Y-%m-%d %H:%M")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Results&lt;/STRONG&gt;&lt;BR /&gt;
2017-09-05 12:00    2&lt;BR /&gt;
2017-09-05 13:00    1&lt;BR /&gt;
2017-09-05 16:00    1&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Expected Results&lt;/STRONG&gt;&lt;BR /&gt;
2017-09-05 12:00    2&lt;BR /&gt;
2017-09-05 13:00    1&lt;BR /&gt;
&lt;EM&gt;2017-09-05 14:00   0&lt;/EM&gt;&lt;BR /&gt;
&lt;EM&gt;2017-09-05 15:00   0&lt;/EM&gt;&lt;BR /&gt;
2017-09-05 16:00    1&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2017 21:51:42 GMT</pubDate>
    <dc:creator>jcrochon</dc:creator>
    <dc:date>2017-09-05T21:51:42Z</dc:date>
    <item>
      <title>Show all buckets of _time in visualization including zero counts</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Show-all-buckets-of-time-in-visualization-including-zero-counts/m-p/318302#M59480</link>
      <description>&lt;P&gt;Hello Splunker,&lt;/P&gt;

&lt;P&gt;I'm trying to display a 'timestamp, event count' visualization including counts of zero events&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;host="[redacted]" src_port=* | bucket _time span=1h | stats count by _time | eval _time=strftime(_time, "%Y-%m-%d %H:%M")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Results&lt;/STRONG&gt;&lt;BR /&gt;
2017-09-05 12:00    2&lt;BR /&gt;
2017-09-05 13:00    1&lt;BR /&gt;
2017-09-05 16:00    1&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Expected Results&lt;/STRONG&gt;&lt;BR /&gt;
2017-09-05 12:00    2&lt;BR /&gt;
2017-09-05 13:00    1&lt;BR /&gt;
&lt;EM&gt;2017-09-05 14:00   0&lt;/EM&gt;&lt;BR /&gt;
&lt;EM&gt;2017-09-05 15:00   0&lt;/EM&gt;&lt;BR /&gt;
2017-09-05 16:00    1&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 21:51:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Show-all-buckets-of-time-in-visualization-including-zero-counts/m-p/318302#M59480</guid>
      <dc:creator>jcrochon</dc:creator>
      <dc:date>2017-09-05T21:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Show all buckets of _time in visualization including zero counts</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Show-all-buckets-of-time-in-visualization-including-zero-counts/m-p/318303#M59481</link>
      <description>&lt;P&gt;Try this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="[redacted]" src_port=* 
| bucket _time span=1h 
| stats count as mycount by _time 
| appendpipe 
    [| stats min(_time) as mintime max(_time) as maxtime 
     | eval maxtime=maxtime+1 
     | eval mytime=mvrange(mintime, maxtime,3600) 
     | mvexpand mytime 
     | eval _time=mytime 
     | eval mycount=0 
     | table _time mycount
     ]
| stats sum(mycount) as mycount by _time 
| eval _time=strftime(_time, "%Y-%m-%d %H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Sep 2017 22:55:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Show-all-buckets-of-time-in-visualization-including-zero-counts/m-p/318303#M59481</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-05T22:55:02Z</dc:date>
    </item>
  </channel>
</rss>

