Splunk Search

List of users sharing files

fuzzy_rocks
Explorer

I am looking to get a list of unique users who share files. The logs have an entry when a file is accessed with the FileID and the UserID. Doing something like .....| stats dc(UserID) AS UserCount by FileID | where UserCount>1 gives me the number of files that are shared (more than 1 user accessed it), but I don't quite know how to extract the list of distinct UserIDs from that list. I've tried chart, but with a large number of users (>10,000) it produces a huge number of columns and seems to crash. i'm really just after the count of unique UserIDs, so if there is a way to produce just that number and avoid a huge table output that would be very helpful. Thanks!

Tags (3)
0 Karma
1 Solution

Ayn
Legend

The stats command values() does this.

... | stats dc(UserID) AS UserCount, values(UserID) as UniqueUsers by FileID | ...

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions

View solution in original post

Ayn
Legend

The stats command values() does this.

... | stats dc(UserID) AS UserCount, values(UserID) as UniqueUsers by FileID | ...

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions

fuzzy_rocks
Explorer

Thanks - exactly what I was looking for!

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...