Getting Data In

Search for logs before and after given timestamp

ryanholland
Explorer

I would like to be able to provide a timestamp and have splunk return the log nearest/before the timestamp and nearest/after the timestamp, essentially bookending the provided timestamp.

The use case is that a report is given to me with an "event" occurring at a give timestamp. I want to search and find the authentication "start" and authentication "stop" messages for the device/user associated with the event that encompass the timestamp.

Ideas?

0 Karma

Ayn
Legend
0 Karma

Ayn
Legend

If it's not so much a matter of getting events based on time, but rather the IP address, it sounds like a subsearch could be more useful? http://docs.splunk.com/Documentation/Splunk/5.0.2/Tutorial/Useasubsearch

0 Karma

ryanholland
Explorer

Looked over localize, but I'm not sure how to get what I need. Use case is I'm given an IP Address and a timestamp for an event. I then have user logon/logoff logs that have the IP address. So, with the given information, I need to find the associated logon and logoff log that bookmarks the provided timestamp for that IP.

Does this make sense? How can I get this, using localize+map commands or any other means?

0 Karma
Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

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

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...