Splunk Search

help with CASE needed

damucka
Builder

I have the following example:

|makeresults | eval trigger=0|eval decision=case(trigger=1;[|savedsearch test|eval t=1|return $t];0)

producing an error:
Error in 'eval' command: The expression is malformed. Expected )

The intention is clear, I want to execute the savedsearch test under the condition of trigger=1.
Could you please advice what it throws an error?

Kind Regards,
Kamil

Tags (1)
0 Karma

damucka
Builder

sorry, it was an easy mistake. I am closing this question.

0 Karma

niketn
Legend

@damucka if you can please post the fixed query and accept the same as answer to assist others facing similar issue.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

damucka
Builder

Sure.
I changed it to if, also there should be == instead of =

|makeresults | eval trigger=0|eval decision=if(trigger==1,[|savedsearch test|eval t=1|return $t],0)
0 Karma
Get Updates on the Splunk Community!

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...