Splunk Search

search for unique userid in one hour window

dominiquevocat
SplunkTrust
SplunkTrust

I am trying to report the number of unique logged in users (field=USERNAME) in a timespan=1h and since i only want unique users i probably should use dedup but when i run this search for a day or week there is a chance that the same user logged in on several days in that timespan so the dedup should affect only the events within the timespan.

say
index="xxx" | timechart span=1h sum(USERNAME) | dedup USERNAME
is not right. Deduping after that is no use.

Also i would like to have the top number of concurent (see where this goes?) Users in a 1h timespan for a report.

How would i best go about it in a search? How can i report this concurent users max per 1h timespan?

Tags (1)
0 Karma
1 Solution

Ayn
Legend

I don't really understand all of your question, but I'll try to respond according to what I think you're asking.

For a given 1 hour interval, you want to see the distinct count of users that generated events during that timespan. For this, use stats distinct_count (or dc which is the short version).

index="xxx" | timechart span=1h dc(USERNAME)

View solution in original post

0 Karma

Ayn
Legend

I don't really understand all of your question, but I'll try to respond according to what I think you're asking.

For a given 1 hour interval, you want to see the distinct count of users that generated events during that timespan. For this, use stats distinct_count (or dc which is the short version).

index="xxx" | timechart span=1h dc(USERNAME)
0 Karma

dominiquevocat
SplunkTrust
SplunkTrust

DistinctCount sounds nice. I think that does most of what i need.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...