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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...