Splunk Search

How to get distinct values of one field by another field

sridamg
Explorer

the below search will give me distinct count of one field by another field

some search | stats dc(field1) by field2

but how would I get the distinct values for field1 by field2

so i want something like below:

some search | stats distinct(field1) by field2

Tags (3)
0 Karma

pradeepkumarg
Influencer

Check if this helps..

... | dedup field1, field2 | stats list(field1) by field2

MuS
Legend

Hi sridamg,

try something like this:

some search | stats values(field1) by field2

see the docs for more information http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/CommonStatsFunctions

cheers, MuS

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

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