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!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...