Splunk Search

What is the difference between stats eventstats streamstats?

maitrifer
Engager

Hi All I'm new to Splunk and I'm confused between stats eventstats and streamstats. Can anyone help me to understand?

Labels (1)
1 Solution

isoutamo
SplunkTrust
SplunkTrust
Hi
Here is one explanation https://splunkonbigdata.com/2018/09/29/difference-between-streamstats-and-eventstats-command-in-splu.... Shortly streamstats calculate over sliding window and eventstats over all values.
r. Ismo

View solution in original post

vikramyadav
Contributor

stats

Stats calculate aggregate statistics over the dataset, similar to SQL aggregation. If called without a by clause, one row is produced, which represents the aggregation over the entire incoming result set. 

eventstats

Eventstats calculates a statistical result same as stats command only difference is it does not create statistical results, it aggregates them to the original raw data.

streamstats

Streamstats command uses events before the current event to compute the aggregate statistics that are applied to each event.

 

-----------------------------------------------------

If this help your like will be appreciated 🙂

isoutamo
SplunkTrust
SplunkTrust
One addition to streamstats, you could define the window which it use to calculate stats. Also you could define some conditions dynamically for window. There are some cases where this is mandatory to get correct result. https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/Streamstats

isoutamo
SplunkTrust
SplunkTrust
Hi
Here is one explanation https://splunkonbigdata.com/2018/09/29/difference-between-streamstats-and-eventstats-command-in-splu.... Shortly streamstats calculate over sliding window and eventstats over all values.
r. Ismo

ITWhisperer
SplunkTrust
SplunkTrust

stats replaces the pipleline  - only calculated values based all the data in the pipeline are passed down the line

eventstats adds to the pipeline as a whole - calculated values are based on all the data in the pipeline and added as additional fields to the rows passed down the line

streamstats adds to the pipeline as it passes through - calculated values are based on the data received so far

Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...