Dashboards & Visualizations

Combine 2 events by a matching field without using join.

anooshac
Communicator

Hi all,

I have 2 events present in a source type, with different data. There is one field which has same data in both the events but the field names are different. Can anyone suggest a method other than JOIN to combine 2 events? I tried combining the fields by coalesce command, once i combine them i was not able to see the combined fields.

I want to combine the events and do some calculations.

Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @anooshac,

you have to coalesce the key fields and then correclate them using stats:

if the fields to correlate are field1 and field2 and the fields to display are field3 and field4 from the type1 and field5 from type2

index=your_index sourcetype=your_sourcetype type IN (type1, type2)
| eval key=coalesce(field1,field2)
| stats 
     values(field3) AS field3
     values(field4) AS field4
     values(field5) AS field5
     BY key

Cao.

Giuseppe

 

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @anooshac,

you have to coalesce the key fields and then correclate them using stats:

if the fields to correlate are field1 and field2 and the fields to display are field3 and field4 from the type1 and field5 from type2

index=your_index sourcetype=your_sourcetype type IN (type1, type2)
| eval key=coalesce(field1,field2)
| stats 
     values(field3) AS field3
     values(field4) AS field4
     values(field5) AS field5
     BY key

Cao.

Giuseppe

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @anooshac ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...