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!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

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 ...