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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...