<?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 To Use tstats with nested data models - getting empty results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-To-Use-tstats-with-nested-data-models-getting-empty-results/m-p/336964#M99981</link>
    <description>&lt;P&gt;You need to prefix the field name with the data model name: &lt;CODE&gt;avg(AccessLogs.ResponseTimeMillis)&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2017 00:20:47 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2017-04-18T00:20:47Z</dc:date>
    <item>
      <title>How To Use tstats with nested data models - getting empty results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-To-Use-tstats-with-nested-data-models-getting-empty-results/m-p/336963#M99980</link>
      <description>&lt;P&gt;I have a DataModel named "AccessLogs" and it has a DataSet hierarchy that looks like this&lt;BR /&gt;
  RootSearchDS // sourcetype=http_access_log&lt;BR /&gt;
      BusinessHoursDS // Child of RootSearchDS, Some filtering to only include Mon-Fri work hours&lt;BR /&gt;
          BetaDS  // Child of BusinessHoursDS, host=BetaServer*&lt;BR /&gt;
          ProdDS // Child of BusinessHoursDS, host=ProdServer*&lt;/P&gt;

&lt;P&gt;I've enabled the DataModel to be publicly available and I've enabled acceleration for 1 day.&lt;/P&gt;

&lt;P&gt;Now, I'm trying to use the tstats function to return some results about my DataSets.  I'm running queries over around 1-2 Terrabytes of data collected over 3 months.  The normal pivots are very slow - a few hours to run - so I was hoping the tstats function would provide a faster alternative.  I just need basic stats on my DataSets - like avg values segmented by week of the year.&lt;/P&gt;

&lt;P&gt;Here's my tstats command:&lt;/P&gt;

&lt;P&gt;| tstats count avg(ResponseTimeMillis) as "AvgResponse" FROM datamodel=AccessLogs.RootSearchDS WHERE nodename=RootSearchDS.BusinessHoursDS.BetaDS by TimeWeekOfYear &lt;/P&gt;

&lt;P&gt;I can see the count field is populated with data but the AvgResponse field is always blank.  It looks like this field doesn't exist.  But when I pivot off my data model AccessLogs &amp;gt; RootSearch &amp;gt; BusHours &amp;gt; Beta I can see that the ResponseTimeMillis field does exist.&lt;/P&gt;

&lt;P&gt;Anyone know why the avg(ResponseTimeMillis) might be blank?  Did I specify my "datamodel" and "nodename" parameters correctly?  Does ResponseTimeMillis need to be set as a "required" field in my DataSet?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:44:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-To-Use-tstats-with-nested-data-models-getting-empty-results/m-p/336963#M99980</guid>
      <dc:creator>theironcook</dc:creator>
      <dc:date>2020-09-29T13:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: How To Use tstats with nested data models - getting empty results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-To-Use-tstats-with-nested-data-models-getting-empty-results/m-p/336964#M99981</link>
      <description>&lt;P&gt;You need to prefix the field name with the data model name: &lt;CODE&gt;avg(AccessLogs.ResponseTimeMillis)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 00:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-To-Use-tstats-with-nested-data-models-getting-empty-results/m-p/336964#M99981</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-04-18T00:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: How To Use tstats with nested data models - getting empty results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-To-Use-tstats-with-nested-data-models-getting-empty-results/m-p/336965#M99982</link>
      <description>&lt;P&gt;Thanks martin!  Your answer led me to the correct one - almost right.&lt;/P&gt;

&lt;P&gt;I need to append with my root search (not the data model name)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;avg(RootSearchDS.ResponseTimeMillis)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Apr 2017 14:53:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-To-Use-tstats-with-nested-data-models-getting-empty-results/m-p/336965#M99982</guid>
      <dc:creator>theironcook</dc:creator>
      <dc:date>2017-04-18T14:53:29Z</dc:date>
    </item>
  </channel>
</rss>

