Splunk Search

Need to escape % using LIKE.

dawfun
New Member

In my where command I need to use LIKE to match a string containing %. Something like this:

... | where LIKE(myField, "match % this") | ...

I need a literal match on "match % this", to exclude something like "match other things but not this".

So, any thoughts on how to find a literal "%"?

0 Karma
1 Solution

aljohnson_splun
Splunk Employee
Splunk Employee

Use the match function. It takes regular expressions.

| where match(myField, "match % this")

Docs here.

View solution in original post

ldongradi_splun
Splunk Employee
Splunk Employee

Using search instead of where will give you the solution, here.

| search myfield="match % this"
0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

Use the match function. It takes regular expressions.

| where match(myField, "match % this")

Docs here.

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...