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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...