Splunk Search

I would like to use field value * as regex to match all values in my search

TMazurek
New Member

Hello,

I have dashboard with drop-down button. Token for button is named Area. Values are:
Name - Value:
All Areas - All
Business Critical - Critical
Public - Public
Internal - Internal

I have following query:

index=main sourcetype=source1 | rename Computer.SWArea as SWArea | eval variable=case("$Area$" == "All","*","$Area$" == "Critical","Critical","$Area$" == "Public","Public","$Area$" == "Internal","Internal") | search SWArea=variable |

The problem I faced is that when I choose All on my drop-down button it matches 0 events instead of all. The issue is that despite new field variable contains * this doesnt match as any in search section. Any ideas why ?

0 Karma
1 Solution

sundareshr
Legend

Change the value for All Areas to *. Like this

Name - Value:
All Areas - *
Business Critical - Critical
Public - Public
Internal - Internal

And you search to

index=main sourcetype=source1 Computer.SWArea="$Area$

View solution in original post

0 Karma

sundareshr
Legend

Change the value for All Areas to *. Like this

Name - Value:
All Areas - *
Business Critical - Critical
Public - Public
Internal - Internal

And you search to

index=main sourcetype=source1 Computer.SWArea="$Area$
0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...