Splunk Search

how to use a wild card in if condition in eval?

pavanae
Builder

I have an eval condition as below which is working good.

| eval Project=if(app=="abc_def_123", "XYZ", "ZXT")

Now If I have given a wild card as shown below it's not working. How can I apply the wild card as shown below and get the required results?

| eval Project=if(app=="abc_*", "XYZ", "ZXT")
0 Karma

woodcock
Esteemed Legend

You cannot; you must use something else like like or match or searchmatch like this:

... | eval Project=if(match(app, "^abc_"), "XYZ", "ZXT")
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...