Splunk IT Service Intelligence

Why is eventstats causing incorrect values?

EricLloyd79
Builder

alt textI have the query seen in the screenshot and it seems if I use eventstats it returns an incorrect value far larger than it should be for my summation of the difference of two values. If I use stats instead of eventstats, it works as expected.
Can anyone give me any insight why eventstats would be doing this?
Ive attached a screenshot using stats and one with eventstats.

(I need to use eventstats as this is a query for ITSI)

alt text

0 Karma

Vijeta
Influencer

when you use - stats earliest() and latest by host, it is giving you one row per host with earliest and latest value of the fields you mentioned. If you use eventstats instead it will return you all the events from all the host with the earliest and latest value for that host added in each event. For example you have 4 hosts and each host has say 10 events then stats will result into 4 rows/events one for each host with the earliest and the latest value of the field mentioned. In case of eventstats it will give you all the 40 events, with the value of latest and earliest field in all the events based on the host. You should try running both the stats and eventstats command separately to see the difference. Also depending on your need you may need to use stats or eventstats or streamstats.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...