Splunk Search

How to generate a search that will combine my events based on user ID and transaction ID so that my end result will display just 2 events?

nagarjuna280
Communicator

I have an event which contains user id, and two more events which contains user id (same), transaction id (different). I want combine first event and second event as one event and first event and third event as one event. I should get only get two events. How do I do this?

0 Karma

chuckers
Path Finder

Seeing an example of a set of three events would help, but if I understand correctly, then that this might work.

yourQueryThatPullsOnlyTheDesiredEvents | stats values(_raw) AS _raw BY userId transactionId

This will give you
userA txnA _raw
userA txnB _raw

nagarjuna280
Communicator

I want to combine first ,

event1 user id a

event2 user id b

event3 user id a trans id p

event4 user id a trans id q

event3 user id b trans id p

event4 user id b trans id q

output should combine

event1 user id a
event3 user id a trans id p

as one event

event1 user id a
event3 user id a trans id q

as one event

event1 user id b
event3 user id b trans id p

as one event

event1 user id b
event3 user id b trans id q

0 Karma

somesoni2
Revered Legend

What is your end goal (what type of report/aggregation you want to do after combining)? Also, can we have some sample logs and expected output format?

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...