Splunk Search

Count users' successful logins over time

DanAlexander
Communicator

I would like to get the number of people connected (one successful login session per user per day will suffice) to our network over a month period using earliest and now() attributes. The figures should be presented per week like a chart

Labels (4)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

When you say per day and per week do you mean you want unique user count in a week as long as a person logged in once in that week, or do you want to show a daily unique user count AND a weekly unique user count?

Building on @yuanliu comments, to get count of users per day then it's

<some other selectors> event=login status=success earliest=-1mon
| timechart span=1w@w dc(user) as users

will give you a weekly unique count from Sun->Sat

If you want to get unique by day as well as by week, then do the daily dc() count and save the values and then after bin by week and add in the dc() count for the week

| timechart span=1d dc(user) as users values(user) as tmp_users
| eval t=_time
| bin t span=1w@w 
| eventstats dc(tmp_users) as weekly_users by t
| fields - tmp_users t

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

You have to tell volunteers how your data looks like.  Forget Splunk.  How do you tell there is a new login, how do you tell a new login is successful from your data?

Suppose your data have three fields, user, event, and status, where event "login" signifies a new login, and status "success" signifies success.  A generic way to do this would be

<some other selectors> event=login status=success earliest=-1mon
| timechart span=1d count by user

 

Tags (1)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...