Splunk Search

Join with different fields names.

brodde
Engager

Hi,

I'm trying to port some SQL queries we wrote to Splunk but whereas with SQL I can specify which columns to join whatever their names are I couldn't replicate that in Splunk.

Here's an attempt using aliases (rename didnt work either) :

   sourcetype="call"
    | join type=left callerID as userId
       [search sourcetype="user"
       | fields userId]
    | table event_id callerID userId

Thanks !

Tags (1)

martin_mueller
SplunkTrust
SplunkTrust

Rename certainly works.

If you have two sources like this:

user, field1
foo, value2

and like this:

userId, field2
foo, value2

you can do a search like this:

sourcetype=st1 | rename user as userId | join userId [search sourcetype=st2]

to get this:

userId, field1, field2
foo, value1, value2
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...