Splunk Search

transaction group by two IDs

fk319
Builder

I have data that has two IDs for each transaction. Of course most logs have one or the other and only one has both. I tried:

...| transaction ID, ID2 |...

but found that I would sometimes get two transaction records, one with just ID and the other with both ID and IDs.

I could not find an "OR" option, just that the engine would figure it out. Does anyone have some suggestions?

Tags (1)

yannK
Splunk Employee
Splunk Employee

try to add the presence of the 2 fields as a condition before the transactions :

id=* AND id2=* | transaction id id2

0 Karma

fk319
Builder

Then I would not see the details of id or id2, just the link between the two.

fk319
Builder

those work fine, it seams when I have id1 and id2 defined, then id1 and id2 correlated.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

So the following events all form one big transaction?

event1 id=1
event2 id=1 id2=a
event3 id2=a

0 Karma

fk319
Builder

In this case, one ID is external activity and the other ID is internal activity. some where during the transaction there is an a correlation between the two.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

How do the two IDs relate to each other? In other words, how should events be grouped into one transaction?

0 Karma

fk319
Builder

no, more like
event=1 host=a
event=2 cookie=b
event=3 host=a cookie=b

0 Karma

cramasta
Builder

would you say your data set is like this

event=1 host=a
event=2 host=a cookie=b
event=3 cookie=b

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...