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!

Detecting Brute Force Account Takeover Fraud with Splunk

This article is the second in a three-part series exploring advanced fraud detection techniques using Splunk. ...

Buttercup Games: Further Dashboarding Techniques (Part 9)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Buttercup Games: Further Dashboarding Techniques (Part 8)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...