Splunk Search

How to join extracted, multi-value SourceTypeA:field_a with extracted SourceType:field_b?

DrColombes
New Member

I want to compute a join of an extracted, multi-value SourceTypeA:field_a string variable with an extracted SourceTypeB:field_b string variable.

I've received a partial answer on how to do a "detour join" in Splunk via Intersect and Stats:

(sourcetype="SourceTypeA" ...) OR (sourcetype="SourceTypeB" ...)

| eval c = if (sourcetype=="SourceTypeA", SourceTypeA:field_a, SourceTypeB:field_b)

| stats values (x) values (y) values(z) by c

I'm guessing the searches (for the extracted, multi-value field_a and extracted field_b) go in the sourcetype clauses above.

I want to output the values where SourceTypeA:field_a = SourceTypeB:field_b.

Thanks for your help.

0 Karma

woodcock
Esteemed Legend

You have the correct solution, even for multi-value fields, except for the whitespaces between values and (; this should work fine:

(sourcetype="SourceTypeA" ...) OR (sourcetype="SourceTypeB" ...) | eval joiner = if (sourcetype=="SourceTypeA", SourceTypeA:field_a, SourceTypeB:field_b) | stats values(*) AS * by joiner
0 Karma

Stephen_Sorkin
Splunk Employee
Splunk Employee

Which field do you want to display from SourceTypeA and SourceTypeB? The recipe is the same regardless of whether field_a and field_b are multivalued.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...