Splunk Search

Need query of sum of distinct count.

pinpra
New Member

I need sum of distinct count for following condition :

distinct_count(email_id) where event_name=email and distinct_count(person_id) where event_name=push.

Please suggest.

Thanks in advance for help.

0 Karma

cmerriman
Super Champion

how about something like this:

|eval emailDC=if(event_name=email,email_id,null())|eval personDC=if(event_name=push,person_id,null())|stats dc(emailDC) as emailDC dc(personDC) as personDC
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...