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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...