Splunk Search

Joining Two Sources

raghu0463
Explorer

Hi,

i was using data from 2 different sources, and joining with join key word, my question is when i want to display the output fields using table key word, if the fields are unique i can just give the field name, if there is a field with same name from both the sources then how should i output the field from only particular source.

Tags (2)
0 Karma
1 Solution

sbbadri
Motivator

Please see below

index=aaa source=a.log field1=* field2=* | join [ search index=aaa source=b.log field1=* field2=* | rename field1 as field1.b, rename field2 as field2.b | fields field1.b field2.b ] | table field1 field2 field1.b field2.b

View solution in original post

0 Karma

sbbadri
Motivator

Please see below

index=aaa source=a.log field1=* field2=* | join [ search index=aaa source=b.log field1=* field2=* | rename field1 as field1.b, rename field2 as field2.b | fields field1.b field2.b ] | table field1 field2 field1.b field2.b

0 Karma

somesoni2
Revered Legend

You've to rename the common field in the join subsearch (second search). As you'd have already figured out, the join command is slow as sloth, so if you could share your current join search and describe your requirement, we may be able to suggest something more efficient.

0 Karma
Get Updates on the Splunk Community!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...