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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...