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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...