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!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...