Splunk Search

String compare regex wildcard

darioapis
Explorer
(( host="vwp054" AND source="E:\\Apache\\apisit\\*"))  | eval site = if(match(source,"E:\A.*"),1,0)  | eval aba = if(source=="E:\\Apache\\apisit\\*",1,0)

I want "aba" to be one, or "site" to be one, but splunk gives me zero. I guess that probably I can't use *(wildcard) in string comparison or not even in match function. Can you help me specify the string comparison expression.

0 Karma

vishaltaneja070
Motivator

Try this:

| makeresults  | eval source="E:\\Apache\\apisit\\*" | eval site = if (source like "E:\A%",1,0) | eval api = if(source like "E:\Apache\a%",1,0)
0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...