Security

Chart of unique user logins per day

jeck11
Path Finder

I feel like an idiot because this should be simple. I'm trying to get a basic graph showing unique user logins per day for our Splunk Cloud environment. This search came from the "Utilization Monitor for Splunk" app and I thought it would be as easy as adding "by day" to the stats segment but that didn't work.

index=_audit user!="splunk-system-user" user!="N/A" user=* host=* NOT (action=log* info=fail*) | stats dc(user) as "Splunkers"

If I were the only user to log in and I only work mon-fri then I would expect the chart to be something like 0,1,1,1,1,1,0.
alt text

Can someone please point out what I'm missing before I lose the little hair I have left?

Tags (2)
0 Karma
1 Solution

to4kawa
Ultra Champion
index=_audit user!="splunk-system-user" user!="N/A" user=* host=* NOT (action=log* info=fail*)
| eval date_wday=strftime(_time,"%F")
| chart dc(user) as "Splunkers" by  date_wday,user
| eval date_wday=strftime(strptime(date_wday,"%F"),"%A")

View solution in original post

0 Karma

to4kawa
Ultra Champion
index=_audit user!="splunk-system-user" user!="N/A" user=* host=* NOT (action=log* info=fail*)
| eval date_wday=strftime(_time,"%F")
| chart dc(user) as "Splunkers" by  date_wday,user
| eval date_wday=strftime(strptime(date_wday,"%F"),"%A")
0 Karma

jeck11
Path Finder

index=_audit user!="splunk-system-user" user!="N/A" user=* host=* NOT (action=log* info=fail*)
| eval date_wday=strftime(_time,"%F")
| chart dc(user) as "Splunkers" by date_wday

Thank you! The strftime is the key for getting the data I needed.

0 Karma

Anantha123
Communicator

Hi,

Try this

index=_audit user!="splunk-system-user" user!="N/A" user=* host=* NOT (action=log* info=fail*) | chart dc(user) as "Splunkers" by user , date_wday

Thanks
Anantha

0 Karma

jeck11
Path Finder

That broke it down more granularly than I was looking for. I updated the question with an example chart.

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