Splunk Search

How to use dedup on a field, but aggregate all other values in another field?

Presh
New Member

I am running a search to identify all users and the URLs they have connected to. The result includes duplicate users, but different URLs. I would like to dedup the users field, but have it list all URLs each user as connected to.

The results currently look like this:

User       URLS
Mak        Cnn.com
Mak        Google.com
Mak        Yahoo.com
Bam        Aljazeera.com
Bam        BBC.com

I would like it to look like this;

User       URLS
Mak        Cnn.com
           Google.com
           Yahoo.com
Bam        Aljazeera.com
           BBC.com

I hope this makes sense.

The current search is .... | table user src_user. If I use the dedup value against the src_user, I lose all the URLs except for one that associates with each user returned in the dedup function.

Thanks,

0 Karma
1 Solution

javiergn
Super Champion
| yourquery
| stats list(URLS) as URLS by User

View solution in original post

0 Karma

javiergn
Super Champion
| yourquery
| stats list(URLS) as URLS by User
0 Karma

javiergn
Super Champion

Note that list won't do dedup on URLs, you can use values instead if you want this to happen:

| inputcsv mycsv.csv
| stats values(URLS) as URLS by User
0 Karma

Presh
New Member

Thanks Javiergn, it works.

0 Karma
Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

June 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...