Splunk Search

Is it possible to pass dynamic field name to kvstore lookup?

Murali2888
Communicator

Hi All,
I need to lookup a value on three different kvstore fields based on its regex format. Is it possible to pass dynamic field name to kvstore lookup?

Lets say, I have three field lookup - userid, mail, secondaryids. I want to achieve something like below.
| lookup records_lookup $arg$
- where arg would be mail if value is of email id format
- where arg would be userid if value is of aXXXXXX
- where arg would be secondaryids if value is of bXXXXXX

I am trying to avoid multiple lookup statements into my search as the lookup value can only be of one format.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...