<?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 produce rows for non-existing time buckets? in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329924#M19643</link>
    <description>&lt;P&gt;Thanks, this does the magic!!&lt;BR /&gt;
However it's worth noting that I need to do &lt;CODE&gt;fillnull value=0&lt;/CODE&gt; after &lt;CODE&gt;timechart&lt;/CODE&gt; before &lt;CODE&gt;untable&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2018 16:07:49 GMT</pubDate>
    <dc:creator>neilli92</dc:creator>
    <dc:date>2018-03-05T16:07:49Z</dc:date>
    <item>
      <title>How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329912#M19631</link>
      <description>&lt;P&gt;I have produced a table like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;+----------+---------+---------+-------+
| _time    | field_1 | field_2 | count |
+----------+---------+---------+-------+
| 08:00:00 | A       | 1       | 2     |
+----------+---------+---------+-------+
| 08:00:00 | B       | 1       | 4     |
+----------+---------+---------+-------+
| 08:00:03 | B       | 3       | 1     |
+----------+---------+---------+-------+
| 08:00:03 | A       | 2       | 3     |
+----------+---------+---------+-------+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to know:&lt;BR /&gt;
what's average &amp;amp; maximum count, per (field_1+field_2) combination, per second.&lt;BR /&gt;
The problem is the _time is missing some seconds, so the &lt;CODE&gt;stats count&lt;/CODE&gt; result only give me the aggregated results on existing time buckets.&lt;/P&gt;

&lt;P&gt;How can I expand this table to include every missing time seconds, just by filling count=0, for each (field_1+field_2) combination? As long as I can do this, I can get the result simply by &lt;CODE&gt;stats avg(count) max(count) by field_1 field_2&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329912#M19631</guid>
      <dc:creator>neilli92</dc:creator>
      <dc:date>2020-09-29T18:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329913#M19632</link>
      <description>&lt;P&gt;hey neilli92,&lt;/P&gt;

&lt;P&gt;You can try the query below:&lt;BR /&gt;
...|stats avg(count) max(count) by field_1,field_2,_time | fillnull value=0&lt;BR /&gt;
Let me know if this helps!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329913#M19632</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2020-09-29T18:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329914#M19633</link>
      <description>&lt;P&gt;thanks for reply, unfortunately it doesn't seem to solve my problem. Because there's no &lt;CODE&gt;null&lt;/CODE&gt; value in the table, it's just I want to append new rows to semantically fill the missing time gap.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 13:24:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329914#M19633</guid>
      <dc:creator>neilli92</dc:creator>
      <dc:date>2018-03-05T13:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329915#M19634</link>
      <description>&lt;P&gt;@neilli92, what is the command you have used to arrive at the table above in the question?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 13:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329915#M19634</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-05T13:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329916#M19635</link>
      <description>&lt;P&gt;Hi, quite a huge query, but I did use &lt;CODE&gt;bucket _time span=1s&lt;/CODE&gt; to buketize the time. Is there any way I can fill the missing time slots with this command?&lt;/P&gt;

&lt;P&gt;I did try with &lt;CODE&gt;timechart&lt;/CODE&gt;, but I couldn't make it work with &lt;CODE&gt;BY&lt;/CODE&gt; two fields. I also tried to concatenate &lt;CODE&gt;field_1&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;field_2&lt;/CODE&gt; to a single string field, but I have so many combinations, that &lt;CODE&gt;timechart&lt;/CODE&gt; just gave up after showing a few, and put everything else in a &lt;CODE&gt;other&lt;/CODE&gt; field.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 13:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329916#M19635</guid>
      <dc:creator>neilli92</dc:creator>
      <dc:date>2018-03-05T13:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329917#M19636</link>
      <description>&lt;P&gt;@neilli92, can you try the following?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt; field1=* field2=*
| eval key=field_1." - ".field2
| timechart span=1s count by key limit=0 useother=f usenull=f
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Mar 2018 13:50:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329917#M19636</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-05T13:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329918#M19637</link>
      <description>&lt;P&gt;I do not know if this will work or not but you can give it a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your base search&amp;gt; 
| eval field= field_1 + "|" + field_2 
| timechart limit span=1s count by field 
| untable _time field count 
| eval temp = split(field,"|") 
| eval field_1 = mvindex(temp,0) 
| eval field_2 = mvindex(temp,1) 
| stats sum(count) as count by field_1 field_2 _time | sort- _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 14:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329918#M19637</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-03-05T14:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329919#M19638</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I think what you might be after is &lt;CODE&gt;makecontinuous&lt;/CODE&gt;? &lt;BR /&gt;
Have a look at &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Makecontinuous"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Makecontinuous&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Here are two examples below of before/after using &lt;CODE&gt;makecontinuous&lt;/CODE&gt; (and also using &lt;CODE&gt;fillnull&lt;/CODE&gt; to fill the gaps).&lt;/P&gt;

&lt;P&gt;Before:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4502i88D14E7D2D7BF339/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;After:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4503i354474DAD17C3D63/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 14:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329919#M19638</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2018-03-05T14:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329920#M19639</link>
      <description>&lt;P&gt;It almost worked! But the only problem is I have too many combinations of field_1 &amp;amp; field_2, it seems &lt;CODE&gt;timechart&lt;/CODE&gt; can't handle so many, so it gave up after showing a few, and put everything else in a field &lt;CODE&gt;OTHER&lt;/CODE&gt;. So after the &lt;CODE&gt;untable&lt;/CODE&gt; command, I only get 19 useful, and one &lt;CODE&gt;OTHER&lt;/CODE&gt; row that includes everything else...&lt;/P&gt;

&lt;P&gt;How can I prevent &lt;CODE&gt;timechart&lt;/CODE&gt; from truncating my results?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:18:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329920#M19639</guid>
      <dc:creator>neilli92</dc:creator>
      <dc:date>2020-09-29T18:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329921#M19640</link>
      <description>&lt;P&gt;Hi thanks for reply.&lt;/P&gt;

&lt;P&gt;It doesn't work, it complains about duplicate _time. Because for different &lt;CODE&gt;field1+field2&lt;/CODE&gt; combinations, I may have duplicate _time.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 14:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329921#M19640</guid>
      <dc:creator>neilli92</dc:creator>
      <dc:date>2018-03-05T14:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329922#M19641</link>
      <description>&lt;P&gt;On the &lt;CODE&gt;timechart&lt;/CODE&gt; command you can add a &lt;CODE&gt;limit=1000 useother=f&lt;/CODE&gt; - That will allow 1000 results. &lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 15:00:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329922#M19641</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2018-03-05T15:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329923#M19642</link>
      <description>&lt;P&gt;I think limit=0 would give unlimited results. And yes to get rid of other use &lt;CODE&gt;useother=f&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 15:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329923#M19642</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-03-05T15:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329924#M19643</link>
      <description>&lt;P&gt;Thanks, this does the magic!!&lt;BR /&gt;
However it's worth noting that I need to do &lt;CODE&gt;fillnull value=0&lt;/CODE&gt; after &lt;CODE&gt;timechart&lt;/CODE&gt; before &lt;CODE&gt;untable&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 16:07:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329924#M19643</guid>
      <dc:creator>neilli92</dc:creator>
      <dc:date>2018-03-05T16:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to produce rows for non-existing time buckets?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329925#M19644</link>
      <description>&lt;P&gt;Excellent - Got there in the end &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 16:09:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-produce-rows-for-non-existing-time-buckets/m-p/329925#M19644</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2018-03-05T16:09:35Z</dc:date>
    </item>
  </channel>
</rss>

