Splunk Search

way to run mulitple fields against a lookup, with OR statement

spicy
Path Finder

I am trying to run two fields against one column using a lookup. 

This SPL does not work, but conveys what I am trying to do.

| lookup blacklist.csv ioc_list AS (src_ip OR dest_ip) OUTPUTNEW ioc_list,  feedback

 

Is there a way I can do something like the above command without running two separate lookup commands?

Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

@spicy 

You can use a multivalue field as the lookup, i.e.

| eval ioc_list_mv=mvappend(src_ip, dest_ip)
| lookup blacklist.csv ioc_list AS ioc_list_mv OUTPUT ioc_list as found_ioc_list,  feedback

Not sure your intentions with the OUTPUTNEW use case. If both src and dest ips exist in the lookup, then the lookup will only return the first value of the multivalue field it finds.

How many ips do you have in the lookup and have you found a performance issue with the lookup in general? You can setup a lookup definition that does batch requests if performance is an issue. You could also use a KV store with accelerated fields of the IP address which are pretty quick.

 

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

@spicy 

You can use a multivalue field as the lookup, i.e.

| eval ioc_list_mv=mvappend(src_ip, dest_ip)
| lookup blacklist.csv ioc_list AS ioc_list_mv OUTPUT ioc_list as found_ioc_list,  feedback

Not sure your intentions with the OUTPUTNEW use case. If both src and dest ips exist in the lookup, then the lookup will only return the first value of the multivalue field it finds.

How many ips do you have in the lookup and have you found a performance issue with the lookup in general? You can setup a lookup definition that does batch requests if performance is an issue. You could also use a KV store with accelerated fields of the IP address which are pretty quick.

 

spicy
Path Finder

@bowesmana 

 

Thanks!

this will work for my needs, I only have one column of blacklist ips.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...