Splunk Search

String validation in eval command

marellasunil
Communicator

Eval is not validating "string" proparly, means status=Normal is not validating. It is perfectly working for numaric values.
Ex : .. | eval AlertStatus=if(status="Normal", "Ok", "Not Ok")
for every Status it is displying OK.

Tags (2)
0 Karma

marellasunil
Communicator

Yes I have used it but still it did't work for me 😞

0 Karma

Ayn
Legend

You should use double equals signs.

... | eval AlertStatus=if(status=="Normal","Ok","Not Ok")
0 Karma

marellasunil
Communicator

Yes I have used it but still it did't work for me 😞

0 Karma
Get Updates on the Splunk Community!

Pro Tips for First-Time .conf Attendees: Advice from SplunkTrust

Heading to your first .Conf? You’re in for an unforgettable ride — learning, networking, swag collecting, ...

Raise Your Skills at the .conf25 Builder Bar: Your Splunk Developer Destination

Calling all Splunk developers, custom SPL builders, dashboarders, and Splunkbase app creators – the Builder ...

Hunt Smarter, Not Harder: Discover New SPL “Recipes” in Our Threat Hunting Webinar

Are you ready to take your threat hunting skills to the next level? As Splunk community members, you know the ...