<?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 autofill rows in a table, even if there are no values produced by streamstats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228514#M67586</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have an output table like below from a streamstats call on my events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;period    total   cummulative_total
1             14           14
3             15           29
4              5           34
6             10           44
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where periods are time spans of 2h and total and cumulative total are sums from stats and streamstats respectively. &lt;/P&gt;

&lt;P&gt;What I would like to ask is whether there is a way to autocomplete data rows for a full set of periods. in the example above periods 2 , 5 ,7....12 are missing as you see. I would like to end up with a table like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;period    total   cummulative_total
 1             14           14
 2              0           14
 3             15           29
 4              5           34
 5              0           34
 6             10           44
 .              .           .
 .              .           .
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so period 2 and 5 as for example take totals as 0, but keep cumulative ones from previous period stats.&lt;/P&gt;

&lt;P&gt;Many thanks in advance,&lt;BR /&gt;
Dimoklis.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2016 14:25:35 GMT</pubDate>
    <dc:creator>dimoklis</dc:creator>
    <dc:date>2016-01-11T14:25:35Z</dc:date>
    <item>
      <title>How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228514#M67586</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have an output table like below from a streamstats call on my events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;period    total   cummulative_total
1             14           14
3             15           29
4              5           34
6             10           44
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where periods are time spans of 2h and total and cumulative total are sums from stats and streamstats respectively. &lt;/P&gt;

&lt;P&gt;What I would like to ask is whether there is a way to autocomplete data rows for a full set of periods. in the example above periods 2 , 5 ,7....12 are missing as you see. I would like to end up with a table like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;period    total   cummulative_total
 1             14           14
 2              0           14
 3             15           29
 4              5           34
 5              0           34
 6             10           44
 .              .           .
 .              .           .
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so period 2 and 5 as for example take totals as 0, but keep cumulative ones from previous period stats.&lt;/P&gt;

&lt;P&gt;Many thanks in advance,&lt;BR /&gt;
Dimoklis.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 14:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228514#M67586</guid>
      <dc:creator>dimoklis</dc:creator>
      <dc:date>2016-01-11T14:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228515#M67587</link>
      <description>&lt;P&gt;Is total number of periods a constant?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 15:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228515#M67587</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-01-11T15:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228516#M67588</link>
      <description>&lt;P&gt;hi sundareshr, yes it is. these are 2h time spans within a day string from 00,02,04,...22 (12 total)&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 15:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228516#M67588</guid>
      <dc:creator>dimoklis</dc:creator>
      <dc:date>2016-01-11T15:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228517#M67589</link>
      <description>&lt;P&gt;Have you tried using the &lt;CODE&gt;timechart&lt;/CODE&gt; command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=2h count as total | streamstats sum(total) as cummulative_total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Look at the &lt;CODE&gt;fixedrange&lt;/CODE&gt; &lt;CODE&gt;usenull&lt;/CODE&gt; and &lt;CODE&gt;cont&lt;/CODE&gt; options for this command&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Timechart"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Timechart&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 15:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228517#M67589</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-01-11T15:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228518#M67590</link>
      <description>&lt;P&gt;Can you post your search?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 06:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228518#M67590</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-01-12T06:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228519#M67591</link>
      <description>&lt;P&gt;hi and thanks @Iguinn, please see below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|bucket _time span=2h |stats sum(quantity) as total by id, _time | streamstats sum(total) as cumulative_total by id| eval period=strftime(_time,"%H")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS. Ihave tried with timechart which can automatically fill the gaps in time and values but my data gets transposed. I need to maintain the table layout as per the example if possible&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 16:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228519#M67591</guid>
      <dc:creator>dimoklis</dc:creator>
      <dc:date>2016-01-12T16:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228520#M67592</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | timechart span=2h sum(quantity) as total by id | untable _time id total | streamstats sum(total) as cumulative_total by id| eval period=strftime(_time,"%H")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jan 2016 17:35:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228520#M67592</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-12T17:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to autofill rows in a table, even if there are no values produced by streamstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228521#M67593</link>
      <description>&lt;P&gt;Thanks somesoni2, found it yesterday using the same logic as you suggested!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 10:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-autofill-rows-in-a-table-even-if-there-are-no-values/m-p/228521#M67593</guid>
      <dc:creator>dimoklis</dc:creator>
      <dc:date>2016-01-13T10:25:16Z</dc:date>
    </item>
  </channel>
</rss>

