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!

Building Reliable Asset and Identity Frameworks in Splunk ES

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

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...