Splunk Search

Wildcard search from lookup

afulamba
Explorer

Hi,
Is there any way to get all the values in the column from the lookup table to build the default choice option in the drop-down? I want to remove the hard-coded list of hosts in the default and populate it from the look up. I don't want to use static option with All=* as it may pull other host names when I will add the records in the lookup for other environment/location values.
Can some one advise, please?

            <input type="multiselect" token="host" searchWhenChanged="true">
            <label>VM Host</label>
            <prefix>host=</prefix>
            <delimiter> OR host=</delimiter>
            <search>
            <query>| inputlookup gw_host.csv 
            | search environment=stage
            | dedup hostname
            | fields hostname</query>
            <earliest>-15m</earliest>
            <latest>now</latest>
            </search>
            <fieldForLabel>host</fieldForLabel>
            <fieldForValue>hostname</fieldForValue>
            <default>h101,h102,h103</default>
            </input>

File: gw_host.csv
location,environment,hostname
1,stage,h101
2,stage,h102
3,stage,h103

Thanks,
AJ.

0 Karma

afulamba
Explorer

Yes, I am using that query that returns the values appearing in the multiselect options. No issue with that. However, I want to set one more value 'All' as default value in the multiselect which should take the value for all the hosts instead of selecting the individual hosts from the multiselect options. In short, I want to avoid the below hard-coding of the servers and populate it from the lookup table.

h101,h102,h103

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What's wrong with the current query? What results do you get compared to what you want?
Have you tried |inputlookup gw_host.csv where environment=stage?

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Congratulations to the 2025-2026 SplunkTrust!

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

Community Feedback

We Want to Hear from You! Share Your Feedback on the Splunk Community   The Splunk Community is built for you ...

Manual Instrumentation with Splunk Observability Cloud: Implementing the ...

In our observability journey so far, we've built comprehensive instrumentation for our Worms in Space ...