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!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...