<?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 by in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143794#M39995</link>
    <description>&lt;P&gt;I don't know but what I have come to conclude is that you can only do by 1 location at a time, so you have to filter out the others before doing your predict.&lt;/P&gt;

&lt;P&gt;It probably isn't what you want but 1 prediction graph per location might be clearer to the end user, as with 3 predictions in one graph would be very unclear, unless you could turn different locations on/off as you wish.&lt;/P&gt;</description>
    <pubDate>Sun, 10 May 2015 22:22:22 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2015-05-10T22:22:22Z</dc:date>
    <item>
      <title>Predict by</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143792#M39993</link>
      <description>&lt;P&gt;My search result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                       Location    Total
01/01/13 12:00:00.000 AM    Location 1  12
02/01/13 12:00:00.000 AM    Location 1  15
03/01/13 12:00:00.000 AM    Location 1  10
04/01/13 12:00:00.000 AM    Location 1  19
05/01/13 12:00:00.000 AM    Location 1  15
01/01/13 12:00:00.000 AM    Location 2  2
02/01/13 12:00:00.000 AM    Location 2  2
03/01/13 12:00:00.000 AM    Location 2  3
04/01/13 12:00:00.000 AM    Location 2  5
05/01/13 12:00:00.000 AM    Location 2  2
01/01/13 12:00:00.000 AM    Location 3  35
02/01/13 12:00:00.000 AM    Location 3  35
03/01/13 12:00:00.000 AM    Location 3  39
04/01/13 12:00:00.000 AM    Location 3  25
05/01/13 12:00:00.000 AM    Location 3  30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it possible to use predict, for the Total field by Location?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2013 05:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143792#M39993</guid>
      <dc:creator>Parameshwara</dc:creator>
      <dc:date>2013-11-15T05:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Predict by</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143793#M39994</link>
      <description>&lt;P&gt;I also want to know if this possible.  Being able to predict on one piece of data only is very limiting..&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 13:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143793#M39994</guid>
      <dc:creator>mtmoore</dc:creator>
      <dc:date>2013-11-20T13:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Predict by</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143794#M39995</link>
      <description>&lt;P&gt;I don't know but what I have come to conclude is that you can only do by 1 location at a time, so you have to filter out the others before doing your predict.&lt;/P&gt;

&lt;P&gt;It probably isn't what you want but 1 prediction graph per location might be clearer to the end user, as with 3 predictions in one graph would be very unclear, unless you could turn different locations on/off as you wish.&lt;/P&gt;</description>
      <pubDate>Sun, 10 May 2015 22:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143794#M39995</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-10T22:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Predict by</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143795#M39996</link>
      <description>&lt;P&gt;Sorry, you cannot do that. Predict has no "by" clause, like stats, which makes it impossible to make multiple predictions.&lt;/P&gt;

&lt;P&gt;HOWEVER&lt;/P&gt;

&lt;P&gt;If you really need to, and don't really care for performance, you could use the map command to do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... your search resulting in a list of Locations ... | map [search location=$location$ | timechart something | predict Total]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The map command will loop all of your locations and execute predict for each of them. Then it will append the results of each run to the final results. Just remember this has quite the performance impact because you'll be starting a new search for each location.&lt;/P&gt;

&lt;P&gt;As an alternative you might consider user the R app, which is currently only available on github: &lt;A href="https://github.com/rfsp/r"&gt;https://github.com/rfsp/r&lt;/A&gt;. This app will allow you to run R commands in Splunk, and R is able to make multiple predictions at a time.&lt;/P&gt;

&lt;P&gt;====&lt;/P&gt;

&lt;H1&gt;EDIT&lt;/H1&gt;

&lt;P&gt;The predict function now takes multiple fields, starting of version 6.3.4! Just make a timechart by something and add: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| predict &amp;lt;fields you want to predict&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Mar 2016 10:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143795#M39996</guid>
      <dc:creator>gwobben</dc:creator>
      <dc:date>2016-03-17T10:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Predict by</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143796#M39997</link>
      <description>&lt;P&gt;Providing a clearer example for gwobben's example above, as of 6.4 you can do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... your search string | timechart sum(Total) by Location | rename "Location *" as Location* | predict Location1 Location2 Location3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:49:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143796#M39997</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2016-06-15T20:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Predict by</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143797#M39998</link>
      <description>&lt;P&gt;I think there is a better option. You can use subsearch in predict command that will dynamically generate the list of fields to predict. Using Splunk tutorial data, i.e counting events based on status code and predicting it:&lt;BR /&gt;
&lt;EM&gt;index="tutorial" sourcetype=access_combined_wcookie | timechart count by status | predict [search index="tutorial" sourcetype=access_combined_wcookie | stats values(status) as status | eval status=mvjoin(status, ", ") | rename status as search]&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;subsearch &lt;BR /&gt;
&lt;EM&gt;search index="tutorial" sourcetype=access_combined_wcookie | stats values(status) as status | eval status=mvjoin(status, ", ") | rename status as search&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;will generate list of fields ( 200, 4004, 500,..) that predict command will take an generate prediction from.&lt;BR /&gt;
Just an idea....&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:15:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Predict-by/m-p/143797#M39998</guid>
      <dc:creator>akastulin</dc:creator>
      <dc:date>2020-09-29T16:15:08Z</dc:date>
    </item>
  </channel>
</rss>

