Splunk Search

Search Macro problems, eval and case

fk319
Builder

I am trying to get a case to work with the eval statement inside of a macro and have been unsuccessfull.

I can get this to work:

eval RTime = round(RunTime)

but I am unable to get this to work:

eval RTime = case ( RunTime < 1, 0, 1=1, 1 )
Tags (2)
0 Karma
1 Solution

Lowell
Super Champion

Try:

eval RTime = case ( RunTime < 1, 0, 1==1, 1 )

View solution in original post

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Could you please post the full macro definition (is it an "iseval" macro), and an example of how you are trying to apply it?

0 Karma

Lowell
Super Champion

Try:

eval RTime = case ( RunTime < 1, 0, 1==1, 1 )
0 Karma

fk319
Builder

Thanks, but that did not help. I still get an eval error when I am trying to use the macro.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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