Splunk Search

In a datamodel search why are tstats and stats results not the same?

YUNHYEONG
Explorer

hello splunker.

i changed search to datamodel search(tstats) for speed up.

but, stats and tstats result are slightly different.

average :
ex) tstats : 0.45500000000000007.
stats : 0.4549999999999999.

it is same data.

help me.

Thank you for your reply.

0 Karma
1 Solution

koshyk
Super Champion

I guess you are hitting number precision problem.
Please have a read on , if it's same issue?
https://answers.splunk.com/answers/451887/how-do-i-stop-splunk-from-rounding-values-that-are.html

View solution in original post

0 Karma

DavidHourani
Super Champion

Hi @YUNHYEONG,

Could you please share your stats and tstats query with us ?

Usually if you're not getting the same results it could be that your tstats is running on accelerated whereas stats is taking all data into consideration.

Another reason could be that your DM isn't using all the data because of the defined constraints make sure your DM's constraint is the same as the one you are using with stats search.

Cheers,
David

0 Karma

koshyk
Super Champion

I guess you are hitting number precision problem.
Please have a read on , if it's same issue?
https://answers.splunk.com/answers/451887/how-do-i-stop-splunk-from-rounding-values-that-are.html

0 Karma

FrankVl
Ultra Champion

Did you check whether you get the exact same set of events? Could be that some events have not made it into the data model summary (yet).

0 Karma

YUNHYEONG
Explorer

yes . i checked data. same set of event. all data same

0 Karma

FrankVl
Ultra Champion

Then I guess this is just the wonders of floating point calculations at work? But perhaps someone else here on the board has a better answer for you 🙂

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...