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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...