Splunk Search

Search join with filter

erick_costa
Path Finder

I want to do the SQL in Splunk:

SELECT TB1.*
FROM TB1
JOIN TB2
ON TB2.ID = TB1.ID
WHERE TB2.OPTION = "OPTION 1"

How do I do this?

Tags (2)
0 Karma
1 Solution

rroberts
Splunk Employee
Splunk Employee

Check out this document!

http://www.innovato.com/splunk/SQLSplunk.html

You might find it helpful.

View solution in original post

rroberts
Splunk Employee
Splunk Employee

Check out this document!

http://www.innovato.com/splunk/SQLSplunk.html

You might find it helpful.

sideview
SplunkTrust
SplunkTrust

Although, in many cases the best thing to do is to not think of it as a join, break it down as a) a disjunction (sourcetype=A some terms) OR (sourcetype=B some other terms) b) a little eval to smooth things out in small ways, c) a stats command to pair everything up in the exact same way a join would. the best practice for advanced splunk developers is really to use lookups or stats or transaction, and only actually use the join command as a last resort.

0 Karma

rroberts
Splunk Employee
Splunk Employee

Even better!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...