Splunk Search

How to add a row to a stats chart to display the total number of events with a unique ID?

nfieglein
Path Finder

This is probably simple. I am trying to add a row to stats/chart which displays the total number of events with a unique ID garnered using:

eventstats dc(UniqueID) as MyTotal

The stats will be something like:

search CurrentStatus=Status1 OR CurrentStatus=Status2 | stats count by CurrentStatus
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Depending on whether you want a distinct count over all events or per CurrentStatus, use either of these:

CurrentStatus=Status1 OR CurrentStatus=Status2 | stats count dc(UniqueID) as MyTotal by CurrentStatus

CurrentStatus=Status1 OR CurrentStatus=Status2 | eventstats dc(UniqueId) as MyTotal | stats count first(MyTotal) as MyTotal by CurrentStatus
0 Karma

nfieglein
Path Finder

I am looking for the total of all events regardless of status and then the total of those just with those stati. There are many other stati, but I am showing those stati in relation to the total.

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 Certification at ...

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 ...