Splunk Search

How to merge two events?

Khuzair81
Path Finder

Event1 - Ticket_no = username*, id=111 Event2 - Ticket_no = TKT123, Id =0 Is there any way to merge this 2 events to get stats as : Ticket_no= TKT123, id=111

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this.

<your base search> | eval username=coalesce(UserId, Ticket_no)
| stats values(*) as * by username
---
If this reply helps you, Karma would be appreciated.
0 Karma

Nisha18789
Builder

hi @Khuzair81 , is there a common value between these two events, like how would you decide to merge these events, is this based on timestamps ? Also, you are trying to do this during search time right ?

0 Karma

richgalloway
SplunkTrust
SplunkTrust
How would Splunk know how to merge those events? They must have something in common and the example events do not.
---
If this reply helps you, Karma would be appreciated.

Khuzair81
Path Finder

Hi @richgalloway

There is one thing common in both event but the column name is different. 

Event1 : Ticket_no - username123,

Event2 : Ticket_no. - TKT123, UserId - username123

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...