Splunk Search

How do I simulate doing a left join or outer join using the "lookup" command?

bcronrath
Path Finder

Issue I am running into right now is I have a result set that I want to pull in threshold values that reside in a lookup CSV file. I am looking up based on a cluster title field, but ideally, what I want to happen is for every single cluster title in this lookup file to produce a row, even if there were no results in my actual search for that cluster. Is there a way I can do this?

0 Karma
1 Solution

somesoni2
Revered Legend

Try like this (assuming your current search gives a results set with unique values of field cluster_title)

your current search giving result with fields cluster_title and others
| append [| inputlookup yourlookup.csv | table cluster_title ]
| stats values(*) as * by cluster_title

View solution in original post

somesoni2
Revered Legend

Try like this (assuming your current search gives a results set with unique values of field cluster_title)

your current search giving result with fields cluster_title and others
| append [| inputlookup yourlookup.csv | table cluster_title ]
| stats values(*) as * by cluster_title

bcronrath
Path Finder

works perfectly thank you so much!

0 Karma

cmerriman
Super Champion

you can try to use ...|appendpipe [stats count by clusterTitle |join max=0 clusterTitle [|inputlookup clusterTable.csv]|fields - count]|stats values(*) by clusterTitle

or something along those lines. Without knowing your actual syntax/data, that's the best I got.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...