Career Resources
Post your Splunk jobs. Get career tips!

count number of events for each client?

rhlb18
Observer

Hi Splunkers,

Typically , I am looking for a SPL query to get the names of each client, total error associated  with each client in it. I have used below query which returns the total number of events and total number of clients who are facing this issue. Could someone please help so that, I could further make Pie chart with it.

(index=prod-web) AND "Error looking for client=* invoicingEntityId='*'" | stats count as Total dc(cf_client) as Client

rhlb18_1-1614681174554.png

 

 

0 Karma

rhlb18
Observer

@KailA - Thank your help. But,  I am just thinking if we can count the event the number of invents and not the number of cf_client?

0 Karma

KailA
Contributor

Hello 🙂

You just to do a little modification in your search :

(index=prod-web) AND "Error looking for client=* invoicingEntityId='*'" 
| stats count as Total BY cf_client

 This should return the number of error by client.

Let me know if it helps 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 ...