Splunk Search

space in values not filtering data on dashboard

koreamit3483
Explorer

I have data coming in where I have a field called Result which holds data as below

1) "FAIL"

2) " FAIL "

3) "PASS"

4) " PASS "

now i have created a dashboard where the Result field is used in Drop down box. I have cleared the extra space from the field using

| rex mode=sed field=Result "s/ //g" |

I also have a table showing data of values of PASS and FAIL count where i have also cleared the space using rex command and created fields of Results using 

| stats count(eval(searchmatch("PASS"))) AS PASS count(eval(searchmatch("FAIL"))) AS FAIL |

Now when i filter "FAIL" or "PASS" in drop down and submit, The table on dashboard does not show count for values having space (i.e. " PASS " and " FAIL ") and shows count for only without space values.

how can i solve this.

 

Labels (2)
0 Karma

Sukisen1981
Champion

why not use ltrim on your Result field, this will remove the space from the left side of the values for the Result field and then try out your stats counts

|eval Result=ltrim(Result," ")|..rest of your stats n counts

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

How are you applying the filter (please share your search/dashboard code)?

0 Karma
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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...