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.
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...