Splunk Search

matching multiple constraints in a transaction

cphair
Builder

I need to find hosts on which Event B occurred within three minutes of Event A. I'm trying to use transaction, but I seem to be running into the problem that a transaction is marked closed if either maxspan or startswith is satisfied, and I want all three of these constraints to be satisfied:


... | transaction host maxspan=3m startswith(EventCode=A) endswith(EventCode=B)

Event A is far more common than Event B, so I end up with a lot of transactions consisting only of Event A, which is annoying. unifyends=t doesn't work; A and B have nothing in common with each other, so I just end up with Event A-only transactions. I could try to filter by the EventCode field after the transactions are created, but that seems silly; transaction should be able to do this implicitly. Can I do something in the transaction command to make it honor all three constraints? I am running Splunk 4.3.4.

1 Solution

yannK
Splunk Employee
Splunk Employee

do your transactions with a larger time range, then apply conditions to find the transaction matching your requirements.

... | transaction host maxspan=6m startswith(EventCode=A) endswith(EventCode=B) | search EventCode=B AND duration<=180

View solution in original post

0 Karma

yannK
Splunk Employee
Splunk Employee

do your transactions with a larger time range, then apply conditions to find the transaction matching your requirements.

... | transaction host maxspan=6m startswith(EventCode=A) endswith(EventCode=B) | search EventCode=B AND duration<=180

0 Karma

cphair
Builder

I'll do this, but I still think transaction should be able to do this itself. It seems inefficient to have to pull back all the solo Event As and then discard most of them.

0 Karma
Get Updates on the Splunk Community!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...