Splunk Search

"transaction" command: have four "startswith" and two "endswith" patterns for the same transaction

sp
Loves-to-Learn

I need to run a Splunk search with "transaction" command and I have four pattern variations for the start of the transaction and two pattern variations for the end of that transaction.

I read the documentation and experimented but still not sure how exactly I should do this. I am operating on complex extensive data so it's not immediately clear whether I am doing this correctly and I need to get it right. I tried the following:

1. Wildcards in startswith and endswith: "endswith=...*..."

2. The syntax "endswith=... OR endswith=...".     -- same for startswith

3. The syntax "endswith=... OR ...".

4. Regular expressions instead of wildcards: .* instead of *

Could you suggest the right way of doing this?

Thank you!

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @sp ,

as @bowesmana said, transaction command should be avoided all times that's possible.

probably the only condition when it could be used is when you have to use startswith or endswith conditions.

Anyway, you can use the OR condition:

| transaction startswith=("string1" OR "string2" OR "string3" OR "string4") endswith=("string5" OR "string6")

Ciao.

Giuseppe

0 Karma

bowesmana
SplunkTrust
SplunkTrust

I would suggest looking at ways of NOT using transaction, as it has limitations. stats can often solve the problem of transaction.

Perhaps you can give an example of your data and say what you are trying to achieve - then the right solution may be clearer.

You can use eval statements in starts and endswith, but before you go down that route, let's see what you're trying to get to

 

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...