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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...