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!

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...