Splunk Search

create table of first and last logins for multiple users

tkerr1357
Path Finder

Hello all,

looking to get both the first and last event for each user of the bellow search if anyone can help. 

index=wineventlog EventCode=4624 host=machine1* user=4* OR user=5*

Labels (1)
0 Karma
1 Solution

tkerr1357
Path Finder

I was abler to find a comment someone else made and added this to my base search to resolve my issue thank you

| eval day=strftime(_time,"%d/%m/%Y") | stats earliest(_time) AS earliest latest(_time) AS latest by user host day | eval earliest=strftime(earliest,"%d/%m/%Y %H.%M.%S"), latest=strftime(latest,"%d/%m/%Y %H.%M.%S")

View solution in original post

0 Karma

to4kawa
Ultra Champion

try earliest() and latest() with stats

0 Karma

tkerr1357
Path Finder

I was abler to find a comment someone else made and added this to my base search to resolve my issue thank you

| eval day=strftime(_time,"%d/%m/%Y") | stats earliest(_time) AS earliest latest(_time) AS latest by user host day | eval earliest=strftime(earliest,"%d/%m/%Y %H.%M.%S"), latest=strftime(latest,"%d/%m/%Y %H.%M.%S")

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...