<?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: predict command doesent work in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354971#M105013</link>
    <description>&lt;P&gt;@matansocher, actually I did not get the question quite clearly. However, if your intent is to either include one addition 0 count row per day or remove 0 count for each day. For both the scenarios you can handle the same in SPL i.e. either use &lt;CODE&gt;append&lt;/CODE&gt; or &lt;CODE&gt;appendpipe&lt;/CODE&gt; with &lt;CODE&gt;gentimes&lt;/CODE&gt; to add 0 count rows per day or &lt;CODE&gt;search count!=0&lt;/CODE&gt; before calling the predict command.&lt;/P&gt;

&lt;P&gt;Can you add some sample data with the requirement?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2018 02:08:54 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-04-25T02:08:54Z</dc:date>
    <item>
      <title>predict command doesent work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354966#M105008</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I want to predict values of a field over time.&lt;BR /&gt;
the result table of my search:&lt;/P&gt;

&lt;P&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/4811i51BBB79FCE0EE36E/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;In the end of the search I use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=24h sum(sloc) as SLOC 
| eval _time = strftime(_time, "%Y-%m-%d") 
| fillnull value=0 
| predict SLOC 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the error I get:&lt;BR /&gt;
External search command 'predict' returned error code 1.&lt;/P&gt;

&lt;P&gt;I am using splunk 6.5.7&lt;/P&gt;

&lt;P&gt;the results I would like to see is more days to come with the 'SLOC' predicted value.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Apr 2018 08:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354966#M105008</guid>
      <dc:creator>matansocher</dc:creator>
      <dc:date>2018-04-22T08:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: predict command doesent work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354967#M105009</link>
      <description>&lt;P&gt;@matansocher, perform fieldformat on _time after the prediction command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd log_level!=INFO
| timechart span=24h sum(date_minute) as SLOC
| predict SLOC
| fieldformat _time=strftime(_time,"%Y/%m/%d")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or else use &lt;CODE&gt;span=1d&lt;/CODE&gt; if you want to use daily data for prediction&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd log_level!=INFO
| timechart span=1d sum(date_minute) as SLOC
| predict SLOC
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Apr 2018 11:19:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354967#M105009</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-22T11:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: predict command doesent work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354968#M105010</link>
      <description>&lt;P&gt;To add on to this.. The predict command is very "unpredictable" and I typically stay away from using it. @matansocher didn't specify if his data is seasonal or non-seasonal so perhaps the LLP5 algorithm he's using may not be the best choice.. &lt;/P&gt;

&lt;P&gt;You may also want to consider using the MLTK for time series forecasting as its more flexible and allows you to control sample sizes and gives more feedback &lt;/P&gt;</description>
      <pubDate>Sun, 22 Apr 2018 16:12:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354968#M105010</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-04-22T16:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: predict command doesent work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354969#M105011</link>
      <description>&lt;P&gt;@skoelpin... &lt;CODE&gt;Predict command is very "unpredictable"&lt;/CODE&gt; LOL... true!!!&lt;/P&gt;

&lt;P&gt;@matansocher do read documentation as arguments to predict command in accordance to the type of data being predicted is quite important as stated by @skoelpin. I am just adding the documentation for &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Predict"&gt;Predict&lt;/A&gt; Command and &lt;A href="https://docs.splunk.com/Documentation/MLApp/latest/User/ForecastTimeSeries"&gt;Forecast Time Series Showcase Example&lt;/A&gt; Documentation for &lt;A href="https://splunkbase.splunk.com/app/2890/"&gt;Machine Learning Toolkit&lt;/A&gt; App.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 06:31:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354969#M105011</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-23T06:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: predict command doesent work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354970#M105012</link>
      <description>&lt;P&gt;Thanks you sko and niketnilay for your help. I have managed to use the machine learning tool kit (Forecast Time Series in particular).&lt;BR /&gt;
I have another question.&lt;BR /&gt;
is there a way to tell the algorithm to "strive" one value to 0 in a specific day?&lt;BR /&gt;
I will explain better. our project ends in some date and the SLOC field will then be zero, and I want to predict the value of the SLOC field based on the past, and with knowing that it will be 0 in a specific date.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 08:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354970#M105012</guid>
      <dc:creator>matansocher</dc:creator>
      <dc:date>2018-04-23T08:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: predict command doesent work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354971#M105013</link>
      <description>&lt;P&gt;@matansocher, actually I did not get the question quite clearly. However, if your intent is to either include one addition 0 count row per day or remove 0 count for each day. For both the scenarios you can handle the same in SPL i.e. either use &lt;CODE&gt;append&lt;/CODE&gt; or &lt;CODE&gt;appendpipe&lt;/CODE&gt; with &lt;CODE&gt;gentimes&lt;/CODE&gt; to add 0 count rows per day or &lt;CODE&gt;search count!=0&lt;/CODE&gt; before calling the predict command.&lt;/P&gt;

&lt;P&gt;Can you add some sample data with the requirement?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 02:08:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/predict-command-doesent-work/m-p/354971#M105013</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-25T02:08:54Z</dc:date>
    </item>
  </channel>
</rss>

