<?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: Splunk Datamodel tstats Error in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432855#M123670</link>
    <description>&lt;P&gt;if you run a search &lt;CODE&gt;|from datamodel:"Introspection_Usage"&lt;/CODE&gt;  are you getting any data?&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2019 14:53:54 GMT</pubDate>
    <dc:creator>lakshman239</dc:creator>
    <dc:date>2019-04-26T14:53:54Z</dc:date>
    <item>
      <title>Splunk Datamodel tstats Error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432854#M123669</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have created a datamodel "Introspection_Usage" with global permission with the following dataset as given.&lt;/P&gt;

&lt;P&gt;Datasets&lt;/P&gt;

&lt;P&gt;EVENTS&lt;BR /&gt;
introspection&lt;/P&gt;

&lt;P&gt;Disk Objects&lt;BR /&gt;
Hostwide Resource Usage&lt;BR /&gt;
PerProcess Resource Usage&lt;/P&gt;

&lt;P&gt;When i edit the fields and preview the fields it works.Example field is "data.cpu_user_pct" and the display name is pct_cpu_user.&lt;BR /&gt;
Base search is index=_introspection.&lt;BR /&gt;
But when i use the below commands it does not work. It seems tstats is not able to able to do the average calculation ? i have the same issue for other fields. How do i fix the issue or am i missing something ?&lt;/P&gt;

&lt;P&gt;| tstats avg(Introspection.data.cpu_user_pct) AS CPU_USER FROM datamodel=Introspection_Usage GROUPBY _time host&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432854#M123669</guid>
      <dc:creator>keishamtcs</dc:creator>
      <dc:date>2020-09-30T00:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Datamodel tstats Error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432855#M123670</link>
      <description>&lt;P&gt;if you run a search &lt;CODE&gt;|from datamodel:"Introspection_Usage"&lt;/CODE&gt;  are you getting any data?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 14:53:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432855#M123670</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-04-26T14:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Datamodel tstats Error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432856#M123671</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yes i see data when i run below command.&lt;/P&gt;

&lt;P&gt;|from datamodel:"Introspection_Usage" &lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 15:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432856#M123671</guid>
      <dc:creator>keishamtcs</dc:creator>
      <dc:date>2019-04-26T15:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Datamodel tstats Error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432857#M123672</link>
      <description>&lt;P&gt;we may have to troubleshoot one by one - any results for this if you run for alltime?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count FROM datamodel=Introspection_Usage GROUPBY host _time span=15m
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 15:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432857#M123672</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-04-26T15:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Datamodel tstats Error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432858#M123673</link>
      <description>&lt;P&gt;The command works - | tstats count FROM datamodel=Introspection_Usage GROUPBY host _time span=15m&lt;/P&gt;

&lt;P&gt;Result is given below. The issue is when i use avg,values command.&lt;/P&gt;

&lt;P&gt;host        _time                        count&lt;BR /&gt;
xxxxxxx 2019-04-26 15:15:00 235&lt;BR /&gt;
aaaaaa  2019-04-26 15:30:00 750&lt;BR /&gt;
bbbbb   2019-04-26 15:45:00 714&lt;BR /&gt;
cccccc  2019-04-26 16:00:00 747&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 15:28:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432858#M123673</guid>
      <dc:creator>keishamtcs</dc:creator>
      <dc:date>2019-04-26T15:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Datamodel tstats Error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432859#M123674</link>
      <description>&lt;P&gt;Go to &lt;CODE&gt;Settings&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Data models&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;&amp;lt;Your Data Model&amp;gt;&lt;/CODE&gt; and make a careful note of the string that is directly above the word &lt;CODE&gt;CONSTRAINTS&lt;/CODE&gt;; let's pretend that the word is &lt;CODE&gt;ThisWord&lt;/CODE&gt;.  Then do this:&lt;/P&gt;

&lt;P&gt;Then do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats avg(ThisWord.data.cpu_user_pct) AS CPU_USER FROM datamodel=Introspection_Usage GROUPBY _time host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;P.S.  It is trashy, if not downright evil to deliberately create field names with &lt;CODE&gt;spaces&lt;/CODE&gt; or &lt;CODE&gt;periods&lt;/CODE&gt; ( &lt;CODE&gt;hyphens&lt;/CODE&gt; are not quite as bad, by why not use &lt;CODE&gt;underscores&lt;/CODE&gt;?).  That may also be part of the problem.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 01:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Datamodel-tstats-Error/m-p/432859#M123674</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-27T01:15:53Z</dc:date>
    </item>
  </channel>
</rss>

