Splunk Search

Tstats and stats return difference result

hoangpt
Explorer
Why do I use "tstats" and "stats" but return different results??? I need an explanation.
I use Splunk version 8.2.0image_2021_07_06T12_08_17_604Z.pngimage_2021_07_06T12_08_05_632Z.pngimage_2021_07_06T12_07_27_843Z.pngimage_2021_07_06T12_06_45_242Z.png
Labels (2)
0 Karma
1 Solution

codebuilder
Influencer

tstats returns data on indexed fields. In the case of datamodels (as in your example) this would be the accelerated portion of your datamodel so it's limited by the date range you configured.

stats returns all data on the specified fields regardless of acceleration/indexing. That is the reason for the difference you are seeing.

----
An upvote would be appreciated and Accept Solution if it helps!

View solution in original post

codebuilder
Influencer

tstats returns data on indexed fields. In the case of datamodels (as in your example) this would be the accelerated portion of your datamodel so it's limited by the date range you configured.

stats returns all data on the specified fields regardless of acceleration/indexing. That is the reason for the difference you are seeing.

----
An upvote would be appreciated and Accept Solution if it helps!

hoangpt
Explorer

In my search commands the number of events queried are the same so i think the problem is not the data acceleration

0 Karma

hoangpt
Explorer
  • Can you take a closer look at the pictures. Even the values ​​of the Web.src field return no results
0 Karma

hoangpt
Explorer

I know that. I searched for the data of many days ago but the result was still the same :((( 

0 Karma

codebuilder
Influencer

Running tstats on a datamodel is dependent on the accelerated range. Only results that have been accelerated will be returned, regardless of the date/time picker selection.

Also, you are running two different queries in your examples. One for url_length and another for src.

----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...