<?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: using eval on a field after using the predict function in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175153#M50262</link>
    <description>&lt;P&gt;further comment on EDIT3 &lt;BR /&gt;
maybe best to have holdback=1 on both predict functions so the graph lines up &lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2015 01:49:35 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2015-06-12T01:49:35Z</dc:date>
    <item>
      <title>using eval on a field after using the predict function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175149#M50258</link>
      <description>&lt;P&gt;I have the follwoing search that does prediction, and what I want to do is add another column to this graph, in this case it is test=120000. This work as I would expect.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... earliest=-5d@d latest=+10d@d  Device=Device1 | timechart  span=d max(field1) by Device | predict Device1 as predict1 future_timespan=10 holdback=2 | eval test=120000&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;However I would like to get it to work using a field that is already in the dataset for example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... earliest=-5d@d latest=+10d@d  Device=Device1 | timechart  span=d max(field1) by Device | predict Device1 as predict1 future_timespan=10 holdback=2 | eval test=field2&lt;/CODE&gt;&lt;BR /&gt;
How do I do this?&lt;/P&gt;

&lt;P&gt;I cannot get it to work, nothing shows up. I have even tried &lt;CODE&gt;eval test=max(field2)&lt;/CODE&gt; but I am not sure if this can be done or is it my lack of understanding?  I do not think I can place it as a parameter to &lt;CODE&gt;predict&lt;/CODE&gt; as this will break my predict function. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT1&lt;/STRONG&gt; Alternative method but same INCORRECT RESULT&lt;/P&gt;

&lt;P&gt;I can actually put it as a parameter to the timechart, however it does not show any values for future dates which is what I am trying to achieve using the &lt;CODE&gt;eval&lt;/CODE&gt; method.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... earliest=-5d@d latest=+10d@d Device=Device1 | timechart span=d max(field1) as f1 max(field2) as f2  | predict f1 as predict1 future_timespan=10 holdback=2&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT2&lt;/STRONG&gt; Alternative method but same INCORRECT RESULT&lt;BR /&gt;
Another way to do it, in using &lt;CODE&gt;appendcols&lt;/CODE&gt;, but it produces the same as the above 2 methods: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... earliest=-5d@d latest=+10d@d Device=Device1 | timechart span=d max(field1) as f1 | predict f1 as predict1 future_timespan=10 holdback=2  | appendcols [search index=... earliest=-5d@d latest=+10d@d Device=Device1 | timechart max(field2) as f2 ]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;here is a pic of what I am talking about: (I want the yellow line to continue for the whole timespan)&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/336i26EE9E2443A7F8DF/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;&lt;STRONG&gt;EDIT3&lt;/STRONG&gt; Alternative method but alomost CORRECT RESULT sogetting better &lt;/P&gt;

&lt;P&gt;now this at least looks like I am getting somewhere.&lt;BR /&gt;
I have to do an &lt;CODE&gt;appendcols&lt;/CODE&gt; of a new &lt;CODE&gt;predict&lt;/CODE&gt; function and then drop the &lt;CODE&gt;upper*&lt;/CODE&gt; and &lt;CODE&gt;lower*&lt;/CODE&gt; fields to get what I want.&lt;/P&gt;

&lt;P&gt;The downside to this is that you lose interactivity with the graph, which I don't like, but it is almost acceptable.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... earliest=-5d@d latest=+10d@d Device=Device1 | timechart span=d max(field1) as f1 | predict f1 as predict1 future_timespan=10 holdback=2  | appendcols [search index=... earliest=-5d@d latest=+10d@d Device=Device1 |  | timechart max(field2) as f2 | predict f2 as f2 future_timespan=10] | fields - upper* lower*&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;this is a pic of what I have now&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/337i46ECD26FBFE83A27/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>Fri, 08 May 2015 01:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175149#M50258</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-08T01:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: using eval on a field after using the predict function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175150#M50259</link>
      <description>&lt;P&gt;my EDIT3 answer is the best I can do. &lt;/P&gt;

&lt;P&gt;But surely there is a better way where the interactivity is not lost, I will await someone clever &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 22:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175150#M50259</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-11T22:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: using eval on a field after using the predict function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175151#M50260</link>
      <description>&lt;P&gt;put &lt;CODE&gt;holdback=1&lt;/CODE&gt; in both &lt;CODE&gt;predict&lt;/CODE&gt; functions so they line up.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 22:36:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175151#M50260</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-11T22:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: using eval on a field after using the predict function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175152#M50261</link>
      <description>&lt;P&gt;Comment on Edit3&lt;BR /&gt;
need to add &lt;CODE&gt;span=d&lt;/CODE&gt; &lt;CODE&gt;timechart max(field2) as f2&lt;/CODE&gt; to handle the ability to predict furter into the future&lt;BR /&gt;
this also enables interactivity on the graph so all good. &lt;/P&gt;

&lt;P&gt;But there must be a better way, I will wait...&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 22:53:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175152#M50261</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-11T22:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: using eval on a field after using the predict function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175153#M50262</link>
      <description>&lt;P&gt;further comment on EDIT3 &lt;BR /&gt;
maybe best to have holdback=1 on both predict functions so the graph lines up &lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 01:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-on-a-field-after-using-the-predict-function/m-p/175153#M50262</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-06-12T01:49:35Z</dc:date>
    </item>
  </channel>
</rss>

