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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...