Splunk Search

How do I edit my transaction search to make sure that a certain event is present between the start and end events?

moe44688
New Member

Hi guys,

I am monitoring suspicious user activity using the transaction command. For example, if EventCodes X, Y, and Z (in this order) show up for the same user within 24 hours, an alert will be sent out. So I have most of my search complete. My problem is, I need to make sure that between X and Z the event Y is present.

.....| transaction user startswith=(EventCode=X) endswith=(EventCode=Z) | .....

I appreciate your help!
Thanks

0 Karma
1 Solution

lguinn2
Legend

You could easily do it like this

 ..... 
| transaction user startswith=(EventCode=X) endswith=(EventCode=Z) 
| where EventCode=Y
....

Once the transaction is created, you can search for EventCode = Y and Splunk will retain only the events that have EventCode=Y somewhere within the transaction.

View solution in original post

lguinn2
Legend

You could easily do it like this

 ..... 
| transaction user startswith=(EventCode=X) endswith=(EventCode=Z) 
| where EventCode=Y
....

Once the transaction is created, you can search for EventCode = Y and Splunk will retain only the events that have EventCode=Y somewhere within the transaction.

moe44688
New Member

Thank you very much! This worked perfectly.

0 Karma
Get Updates on the Splunk Community!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...