Splunk Search

Lookup with IP range

MoermansM
New Member

Hi there, what's the best way to append a search with a lookup with ip subnet ranges and some extra information for those IP's?

iprange.csv

 clientip, zone, areacode
127.0.0.1/24, home, 255

I've added the transforms.conf in the app:

[iprange]
filename = iprange.csv
default_match = OK
match_type = CIDR(clientip)

and the search:

 sourcetype=firewall area=* | lookup iprange.csv clientip as src OUTPUT clientip zone area |table src, zone, area

Yet it doesn't seem to work so far, any suggestions?

0 Karma

niddhi
Explorer

I have exactly the same scenario and its not working. I don't want to add the ip's manually as src, that will defeat the purpose of having a dynamic lookup. Any pointers are appreciated.

0 Karma

anjambha
Communicator

Hi MoermansM,

You are not getting output because the ip you are getting from firewall is without subnet and your csv contain ip with subnet so can not map the column.

So in this case the alternative solution for this is to add one more column to your iprange.csv as below: if you are doing this modification then there is no need of transforms.conf.

src, clientip, zone, areacode
127.0.0.1, 127.0.0.1/24, home, 255

then try this ..

sourcetype=firewall area=* | dedup src | lookup iprange.csv src OUTPUT src clientip zone area |table src, clientip, zone, area
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 ...