Splunk Search

validate a value base on the lookup

frankyip
New Member

I have a csv lookup table like:
item, expression
a, "value>12 AND value<14"
b, "value=1"
c, "value!=111 "
d, "value<10 OR value>100"
....

And I have the log like:
2016-09-09 13:13:13, item=a, value=13
2016-09-09 13:13:14, item=b, value=131
2016-09-09 13:13:15, item=c, value=3
2016-09-09 13:13:16, item=d, value=1

I can lookup ouput a new field called expression base on the lookup table. And I want to validate if the value in each record matches the corresponding expression. Is it possible to do that?

Thanks

Tags (1)
0 Karma

sundareshr
Legend

Try this

base search | where [| inputlookup lookup.csv | eval search="item=\"".item."\" AND ".expression | fields search]
0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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