Splunk Search

How to write events within 2 minutes of the first event for the same host?

Splunk77
Explorer

I am working on a query to report on events generated within 2 minutes of the first event for the same host.

In the following example, I need a query to look for any occurrence of EventType 4697 within two minutes of EventType 4624 for the same ComputerName

ComputerName=x (This is a unique field)

EventType=4624

EventType=4697

Thanks.

 

Labels (1)
0 Karma
1 Solution

VatsalJagani
SplunkTrust
SplunkTrust

@Splunk77 - Have you tried the transaction command like below:

index=<your_index> EventType=4624 OR EventType=4697
| transaction ComputerName startswith="EventType=4624" endswith="EventType=4697" maxspan=2m
| search EventType=4697

 

I hope this helps!!!

View solution in original post

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@Splunk77 - Have you tried the transaction command like below:

index=<your_index> EventType=4624 OR EventType=4697
| transaction ComputerName startswith="EventType=4624" endswith="EventType=4697" maxspan=2m
| search EventType=4697

 

I hope this helps!!!

0 Karma

Splunk77
Explorer

Running this query and not quite getting the desired results. I have test events generated within a 2 minute window. Expanded maxspan to 5 minutes to capture a larger window.

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...