Splunk Cloud Platform

Passing a token value with different spaces

DineshElumalai
Engager

Hello

I've sample data with exactly 10 characters with the combination of alphabet (2-4 characters) followed by spaces (2-4 characters) and number (2-4 characters). Refer table for sample field values. underscore represents a space.

SI.NoID
1ABCD__1234
2AB____1234
3ABCD___123
4ABCDE__123

 

In dashboard, I've got filter for ID. The requirement is user can enter single or two spaces between the ABCD and 1234 in the filter box. By passing this token value with irrespective space values we need to fetch the results. Thank you.

 

Labels (2)
Tags (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| eval check=replace($token$," +","\s+")
| where match(ID, check)

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| eval check=replace($token$," +","\s+")
| where match(ID, check)
0 Karma

DineshElumalai
Engager

Initially I was facing error. I passed token inside the quotes "$token$". That worked for me. Thanks a lot.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...