<?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 use makecontinuous in combination with stats to fill in time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338773#M162402</link>
    <description>&lt;P&gt;Any update on if this helped?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 15:32:34 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2018-03-14T15:32:34Z</dc:date>
    <item>
      <title>how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338768#M162397</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have this search query: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="device"
| bucket span=1d _time | makecontinuous _time 
| stats count by _time, user | fillnull count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was expecting that by using makecontinuous the days when the count was 0 will also be added to the results. With this query I get this result.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    _time           user                  count
    2017-08-18  user2                     5
    2017-08-21  user2                  1
    2017-08-25  user2                  4
    2017-08-27  user2                  1
    2017-08-30  user2                  6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was expecting this result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time           user                  count
2017-08-18  user2                     5
2017-08-19  user2                     0
2017-08-20  user2                     0
2017-08-21  user2                  1
2017-08-22  user2                  1
.....and so on
2017-08-25  user2                  4
2017-08-26  user2                  0
2017-08-27  user2                  1
2017-08-30  user2                  6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know that this would work well with timechart but I really need to use stats, so that I can then use the results in Machine Learning Toolkit, and timechart would not work there.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 14:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338768#M162397</guid>
      <dc:creator>jorjiana88</dc:creator>
      <dc:date>2018-03-11T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338769#M162398</link>
      <description>&lt;P&gt;@jorjiana88, try the timechart command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="device" user="*"
| timechart count by user useother=f limit=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Mar 2018 16:53:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338769#M162398</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-11T16:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338770#M162399</link>
      <description>&lt;P&gt;It is not an option to use timechart because it changes how the result is displayed and I cannot later apply some machine learning algorithm after timechart.  I really need to use stats.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 18:31:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338770#M162399</guid>
      <dc:creator>jorjiana88</dc:creator>
      <dc:date>2018-03-11T18:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338771#M162400</link>
      <description>&lt;P&gt;You have some options here. Since the MLTK is appending stats on there, any command such as &lt;CODE&gt;fillnull&lt;/CODE&gt; or &lt;CODE&gt;makecontineous&lt;/CODE&gt; will not solve your issue since it needs to be passed after timechart/stats. &lt;/P&gt;

&lt;P&gt;You need to mock up some dummy data and set its values to zero then allow stats to fill in any non-null values. &lt;/P&gt;

&lt;P&gt;An example would look like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval field1="" | eval field2=""
| append [| search index=... sourcetype=... | bin _time span=10m | stats count by _time | fillnull value=0]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if your time range a 60 min span. The &lt;CODE&gt;makeresults&lt;/CODE&gt; command will create 6 bins with 10 minute time spans and will fill any empty bin with a zero. You could also take the approach of using a lookup table to populate your null values or you could use the internal index to populate placeholders to prevent null values.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 21:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338771#M162400</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-03-11T21:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338772#M162401</link>
      <description>&lt;P&gt;@jorjiana88, is it one of built in Machine Learning Toolkit Algorithm, or you are trying to create your own?&lt;/P&gt;

&lt;P&gt;Can you please give the Algorithm you are trying to use? Outputwise, timechart command above generates same fields as stats command in your query, so I don't see how the two would be picked up differently by the algorithm.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 04:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338772#M162401</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-13T04:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338773#M162402</link>
      <description>&lt;P&gt;Any update on if this helped?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 15:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338773#M162402</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-03-14T15:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338774#M162403</link>
      <description>&lt;P&gt;Perhaps this could help if you wanted it in another format?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart limit=0 span=5m count by user
| fillnull 
| untable _time, user, count
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've used that trick to fill in the missing time points before...let me know if that helps!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 08:22:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338774#M162403</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-03-16T08:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338775#M162404</link>
      <description>&lt;P&gt;this works, I would mark this as answer, but it is a reply, so I cannot mark it.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 16:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338775#M162404</guid>
      <dc:creator>jorjiana88</dc:creator>
      <dc:date>2018-03-16T16:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338776#M162405</link>
      <description>&lt;P&gt;Your answer helped to understand why it does not work. &lt;BR /&gt;
Someone else suggested the solution in one of the replies: &lt;/P&gt;

&lt;P&gt;| timechart limit=0 span=5m count by user&lt;BR /&gt;
| fillnull &lt;BR /&gt;
| untable _time, user, count&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 16:57:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338776#M162405</guid>
      <dc:creator>jorjiana88</dc:creator>
      <dc:date>2018-03-16T16:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338777#M162406</link>
      <description>&lt;P&gt;Moved to answer!&lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2018 04:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338777#M162406</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-03-17T04:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338778#M162407</link>
      <description>&lt;P&gt;Could you please elaborate your solution a bit ? I am faced with a similar issue where _time is discontinuous and MLTK throws error as I try to fit or apply model. TIA. FYI , I am quite new to Splunk but learning things fast. &lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 19:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338778#M162407</guid>
      <dc:creator>bibinksebastian</dc:creator>
      <dc:date>2019-07-05T19:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338779#M162408</link>
      <description>&lt;P&gt;I've come up with a much better solution since posting this reply. Ask a new question and I will give you the code &lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 13:45:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338779#M162408</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-07-08T13:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to use makecontinuous in combination with stats to fill in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338780#M162409</link>
      <description>&lt;P&gt;Thanks . I used time chart to fix my issue currently . please let me know if your soln is different , I will start off a new thread . &lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 18:48:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-makecontinuous-in-combination-with-stats-to-fill-in/m-p/338780#M162409</guid>
      <dc:creator>bibinksebastian</dc:creator>
      <dc:date>2019-07-11T18:48:00Z</dc:date>
    </item>
  </channel>
</rss>

