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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...