Splunk Search

Lookup several times in a KVstore?

christoffertoft
Communicator

I'm working on a kvstore that has multiple interesting columns with which i might determine to enrich an event.

For example, | lookup kvstore a as a

which of course works fine if a exists in the kvstore. However, if this doesn't match to a record,
i'd like to | lookup kvstore b as bif the first one fails, and on and on onto c and d and so on until i find a matching lookup and output that row.

I've tried this by simply putting several lookups after each other as such:

| lookup a as a
| lookup b as b
| lookup c as c

but this breaks, because if a matches I'm happy, i dont need the other lookups, however if a doesn't match, i still need to progress with further lookups..

Does anyone have a solution for this issue?

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

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

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 ...