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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...