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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...