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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...