Splunk Dev

Translating a defined tracking session using SPL

dwong2
New Member

How would I do this in SPL?

I want to calculate a tracking session:
Find an ENTER event in the log.
Search forward in the log data for events after this event with the same device ID and same account ID. Sort them by date (ascending).

Walk through the log events in order, adding them to the session. If any of the following occurs, we stop searching:

If the next is more than "session timeout" (default 5 minutes) after the previous event in the session, consider the session terminated.

If an EXIT or TIMEOUT event occurs, consider the session terminated.

Find the last non-timeout event.
Session duration calculation is based on the time difference between the first event and the last non-timeout event.

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...