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!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...