Splunk Search

How to modify my search to make my field value case INSENSITIVE in an IF statement with a WILDCARD?

saimaday2
Engager

Hi,
I want the "test" field to return a value of 1 for all events with the word "lookup" regardless of case.

index=idm-prdidx  "Intuit.consumer.mintiusgrant.grantjob"
| eval test=if(like(api,"*lookup*"),1,0)
| table api test
0 Karma
1 Solution

sundareshr
Legend

Try this

 index=idm-prdidx  "Intuit.consumer.mintiusgrant.grantjob"
 | eval test=if(match(api,"(?i)lookup"),1,0)
 | table api test

View solution in original post

sundareshr
Legend

Try this

 index=idm-prdidx  "Intuit.consumer.mintiusgrant.grantjob"
 | eval test=if(match(api,"(?i)lookup"),1,0)
 | table api test

saimaday2
Engager

Additionally if I wanted to have the wildcard only at the end of the word and still ignore case sensitivity, how I would I do that?

lookup*

Thanks!

0 Karma

saimaday2
Engager

That works! Thanks!!

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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