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 )

View solution in original post

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