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.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...