<?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 can we use predict command with tstats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563741#M196388</link>
    <description>&lt;P&gt;timechart is using dataset.field for values of field names in the y axis and doesn't exist any more - try predict count&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 06:41:06 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-08-18T06:41:06Z</dc:date>
    <item>
      <title>How can we use predict command with tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563702#M196377</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the following search that works against a datamodel to plot a timechart. How can I use predict command with this output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=true count FROM datamodel="modelname.dataset" where dataset.field="xyz"  by dataset.field, _time span=1h prestats=t  | timechart  span=1h count  by dataset.field usenull=f useother=f&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try to do following,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| predict dataset.field&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="alerts search-searchflashmessages"&gt;&lt;DIV class="alert alert-error"&gt;&amp;nbsp;search failed with this error.&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;&lt;STRONG&gt;command="predict", Unknown field: dataset.field&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;What is the correct way to do this?&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;UPDATE:&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;Turns out, | predict "xyz" works, but this would mean it is working just for that one value of the field.&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="alert alert-error"&gt;Thanks&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Aug 2021 19:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563702#M196377</guid>
      <dc:creator>att35</dc:creator>
      <dc:date>2021-08-17T19:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can we use predict command with tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563710#M196379</link>
      <description>&lt;P&gt;Have you tried renaming the field?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=true count FROM datamodel="modelname.dataset" where dataset.field="xyz"  by dataset.field, _time span=1h prestats=t  
| rename dataset.field as field
| timechart  span=1h count by field usenull=f useother=f
| predict field&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Aug 2021 20:39:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563710#M196379</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-08-17T20:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can we use predict command with tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563725#M196385</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Tried that but now it just gives same error message for field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;command="predict", Unknown field: field&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Aug 2021 02:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563725#M196385</guid>
      <dc:creator>att35</dc:creator>
      <dc:date>2021-08-18T02:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can we use predict command with tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563741#M196388</link>
      <description>&lt;P&gt;timechart is using dataset.field for values of field names in the y axis and doesn't exist any more - try predict count&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 06:41:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563741#M196388</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-18T06:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can we use predict command with tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563769#M196391</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same result.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;command="predict", Unknown field: count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With timechart everything works fine, it plots using dataset.field or even with "field" after rename. But predict doesn't seem to be taking any option as input. Only way predict works here is if I use direct value of the field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| predict value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 12:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-use-predict-command-with-tstats/m-p/563769#M196391</guid>
      <dc:creator>att35</dc:creator>
      <dc:date>2021-08-18T12:30:50Z</dc:date>
    </item>
  </channel>
</rss>

