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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...