Splunk Search

Report on how log a user was logged on?

neiowe
Path Finder

I am trying to generate a report that show how long users stayed logged on. I can do a search and find the users and event codes I am interested in but is there a way of comparing event times and generating a timeframe between events? In other words, is the a way to subtract the time that event code 4624 happened from event code 4634 for Account_Name=XXXX?

Using Splunk 6.3 on Lynx getting events from Wineventlog_security.

somesoni2
Revered Legend

Try something like this

index=YourIndex source="WinEventLog:Security" EventCode=4624 OR EventCode=4634 | transaction Account_Name startswith=EventCode=4624 endswith=EventCode=4634  maxevents=2 | table _time Account_Name duration 
0 Karma
Get Updates on the Splunk Community!

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...