<?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 How to fill the gaps from days with no data in tstats + timechart query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163067#M46279</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm trying to get the statistics of the bytes transferred each day with a query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats prestats=t  sum(bytes) from datamodel=DM earliest=-7d@d latest=@d by _time span=1d | timechart span=1d sum(bytes) as "Bytes"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the results are something like this, skipping the days with no data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time        Bytes
2015-06-16  5509565371
2015-06-17  15556005605
2015-06-18  15556685676
2015-06-19  9722873606 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I need is to fill the days with no data with 0s, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time        Bytes
2015-06-15  0
2015-06-16  5509565371
2015-06-17  15556005605
2015-06-18  15556685676
2015-06-19  9722873606
2015-06-20  0
2015-06-21  0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How could I make that possible without lowering the performance?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jun 2015 10:55:15 GMT</pubDate>
    <dc:creator>mciudad</dc:creator>
    <dc:date>2015-06-22T10:55:15Z</dc:date>
    <item>
      <title>How to fill the gaps from days with no data in tstats + timechart query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163067#M46279</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm trying to get the statistics of the bytes transferred each day with a query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats prestats=t  sum(bytes) from datamodel=DM earliest=-7d@d latest=@d by _time span=1d | timechart span=1d sum(bytes) as "Bytes"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the results are something like this, skipping the days with no data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time        Bytes
2015-06-16  5509565371
2015-06-17  15556005605
2015-06-18  15556685676
2015-06-19  9722873606 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I need is to fill the days with no data with 0s, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time        Bytes
2015-06-15  0
2015-06-16  5509565371
2015-06-17  15556005605
2015-06-18  15556685676
2015-06-19  9722873606
2015-06-20  0
2015-06-21  0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How could I make that possible without lowering the performance?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2015 10:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163067#M46279</guid>
      <dc:creator>mciudad</dc:creator>
      <dc:date>2015-06-22T10:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the gaps from days with no data in tstats + timechart query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163068#M46280</link>
      <description>&lt;P&gt;It should already be doing that (that is what it &lt;EM&gt;does&lt;/EM&gt;) but just in case try adding &lt;CODE&gt;cont=t&lt;/CODE&gt;.  In either case, &lt;EM&gt;DEFINITELY&lt;/EM&gt; open a support ticket to report this bug.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Timechart"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Timechart&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2015 13:11:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163068#M46280</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-22T13:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the gaps from days with no data in tstats + timechart query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163069#M46281</link>
      <description>&lt;P&gt;Thank you, you were right! &lt;/P&gt;

&lt;P&gt;What if there is no data in any day? In that case it returns "No results found. " but it should return just 0 bytes per day.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2015 14:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163069#M46281</guid>
      <dc:creator>mciudad</dc:creator>
      <dc:date>2015-06-22T14:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the gaps from days with no data in tstats + timechart query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163070#M46282</link>
      <description>&lt;P&gt;According to the dox and every usage I have ever tried, &lt;CODE&gt;timechart&lt;/CODE&gt; will fill in any empty &lt;CODE&gt;span&lt;/CODE&gt; slots with 0-values, as long as &lt;CODE&gt;cont=t&lt;/CODE&gt; (which is the default).&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2015 14:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163070#M46282</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-22T14:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the gaps from days with no data in tstats + timechart query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163071#M46283</link>
      <description>&lt;P&gt;I see it was answered to be done using timechart, but how to do the same with tstats.&lt;BR /&gt;
tstats does not show a record for dates with missing data...&lt;/P&gt;

&lt;P&gt;the fillnull_value option also does not work on 726 version.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 06:32:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fill-the-gaps-from-days-with-no-data-in-tstats-timechart/m-p/163071#M46283</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T06:32:02Z</dc:date>
    </item>
  </channel>
</rss>

