<?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 do I add fields to  output from predict in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-fields-to-output-from-predict/m-p/246156#M73395</link>
    <description>&lt;P&gt;I believe the reason you don't see the &lt;CODE&gt;sourcetype&lt;/CODE&gt; is because of the &lt;CODE&gt;timechart&lt;/CODE&gt; command. Try including the &lt;CODE&gt;sourcetype&lt;/CODE&gt; field as an output to that command. Something like this may work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... |  timechart span=1d first(sourcetype) as sourcetype count as Gets | predict Gets | table _time Gets sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 23 Jan 2016 15:47:34 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-01-23T15:47:34Z</dc:date>
    <item>
      <title>How do I add fields to  output from predict</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-fields-to-output-from-predict/m-p/246155#M73394</link>
      <description>&lt;P&gt;I need to locate and alert on counts that are not within predicted bounds.  It seems simple enough using predict, but predict does not include any information regarding the source.  Here is a run anywhere  search which illustrates my concern&lt;/P&gt;

&lt;P&gt;index=_internal sourcetype=splunkd_access* | timechart span=1d count as Gets | predict Gets | eval queueManager=if(1=1, mq_ir360_qmgr,"no") | rename upper95(prediction(Gets)) as ceiling | rename lower95(prediction(Gets)) as floor | eval excession=if(Gets &amp;gt; ceiling, "100", "0") | eval recession=if(Get &amp;lt; floor, "-100", "0") |  table _time Gets, sourcetype&lt;/P&gt;

&lt;P&gt;As you can see, there is no mention of the sourcetype in the results.  I plan to use this within a map loop to check thousands of different hosts and I need to know which host contains an outlier.  I tried to add information, but it is not in the pipe, so I can't(see second example) .  &lt;/P&gt;

&lt;P&gt;How would I get the sourcetype in my output?&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/86183-1-22-2016-4-00-45-pm.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:32:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-fields-to-output-from-predict/m-p/246155#M73394</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2020-09-29T08:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add fields to  output from predict</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-fields-to-output-from-predict/m-p/246156#M73395</link>
      <description>&lt;P&gt;I believe the reason you don't see the &lt;CODE&gt;sourcetype&lt;/CODE&gt; is because of the &lt;CODE&gt;timechart&lt;/CODE&gt; command. Try including the &lt;CODE&gt;sourcetype&lt;/CODE&gt; field as an output to that command. Something like this may work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... |  timechart span=1d first(sourcetype) as sourcetype count as Gets | predict Gets | table _time Gets sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Jan 2016 15:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-fields-to-output-from-predict/m-p/246156#M73395</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-01-23T15:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add fields to  output from predict</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-fields-to-output-from-predict/m-p/246157#M73396</link>
      <description>&lt;P&gt;That worked.  Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 23:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-fields-to-output-from-predict/m-p/246157#M73396</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2016-01-26T23:04:53Z</dc:date>
    </item>
  </channel>
</rss>

