Splunk Search

How do I get an any selection to work on a multiselect where filter?

denymw
Explorer

Hi all,

I am currently working towards generating a user dashboard that requires nothing but text entry and multiselect input values. The user would like to filter by country, but wants an option for any, where it will return results from any country. The current setup is as follows:

searchfunction
$country$

where the $country$ is:
token prefix: | where (
token suffix: )
token value prefix:country="
token value suffix:"
delimiter: OR

for selection "United States" it formats:
searchfunction
|where (country="United States")

for selection of "United States" with "Unknown" it formats:
searchfunction
|where (country="United States" OR country="Unknown"

These return results exactly as expected and desired, but I can't see a way to have an "any" selection without just manually ticking every possible selection. Any ideas would be greatly appreciated.

Kind Regards,
Denym

Tags (1)
0 Karma
1 Solution

cmerriman
Super Champion

try adding one in the Static Options. Name is Any value is *

View solution in original post

0 Karma

cmerriman
Super Champion

try adding one in the Static Options. Name is Any value is *

0 Karma

denymw
Explorer

unfortunately * isn't accepted as a valid wildcard with |where. with the static value put as * it still applies the token and token values, so the statement becomes |where (country="*"), which reads as invalid and breaks the outputs.

0 Karma

cmerriman
Super Champion

why are you using "where"? Can you switch it to "search" and get the results you need?

0 Karma

denymw
Explorer

Changing to a search filter and using the * for the static "all" entry worked perfectly for both single county, multi-country and "all" selection, thank you cmerriman.

0 Karma

cmerriman
Super Champion

just as a note, I generally use "where" to compare two fields and search to filter one field.

for instance:
|where count=totalCount to filter down rows where an event has a count equal to the entire count
|search count>200 to filter down rows where the count is greater than 200

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...