Splunk Search

Lookup Table with CIDR, running but no matches

yoshileigh66
Explorer

Hello, I think this is a simple answer but I'm not able to find a solution. 

I created a lookup table that looks like this (but of course has more info):

Cidr, ip_address

24, 99.99.99.99/24
25, 100.100.100/25

I only included the Cidr column as I read that the lookup table needs at least 2 columns, but I do not use it. Let me know if I should!

I am trying to find source ips that match with the ip_address in my lookup table.   

index="index1" [|inputlookup lookup | rename ip_address as src_ip]

I have ensured that Advanced Settings -> Match -> CIDR(ip_address)

When the query is ran, no matches are found, but I know that there is traffic from the addresses. What am I overlooking?

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
index="index1" 
|lookup lookup ip_address as src_ip
| where isnotnull(Cidr)

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
index="index1" 
|lookup lookup ip_address as src_ip
| where isnotnull(Cidr)

yoshileigh66
Explorer

Thank you so much! 
Out of curiosity, is the isnotnull(CIDR) referring to the column in the lookup table, or to the matchtype that was set up when creating the lookup definition? 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The column in the lookup - essentially, if there is no match in the lookup, the output field will be null.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

That's another solution but it's worth noting the difference in the search process of both those SPLs and the possible difference in performance.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Match type has no meaning with inputlookup.

Your subsearch will get expanded to a set of conditions like

(src_ip="1.2.3.4/24) OR (src_ip="4.5.6.7/23") OR ...)

Verify your expanded search in job dashboard if it matches the field naming in your events.

0 Karma

yoshileigh66
Explorer

Thank you for your response. I double checked and all the fields are correctly spelled.

A coworker put 'AND' in front of the subsearch, and events are returning. She is using a lookup without the match type being set to CIDR(ip_address), so now I'm more puzzled. 

EDIT: Oh yes, I forgot that you said that matchtype doesn't have meaning with inputlookup, so I guess that is why it doesn't matter in this case. Although I'm still puzzled as to why the 'AND' is making a difference. 

 

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...