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!

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...

[Live Demo] Watch SOC transformation in action with the reimagined Splunk Enterprise ...

Overwhelmed SOC? Splunk ES Has Your Back Tool sprawl, alert fatigue, and endless context switching are making ...

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...