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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...