Splunk Search

How to write a search to output results where a field from my events match with a field in my lookup CSV file?

geantver0000
Engager

Hi,

I have found many searches using lookup files, but none works correctly for me What is the correct search to get this?:

My event :
Date, URL, IP

My lookup CSV file:
City, Street, SubnetIP

I want to match the IP on my event with the SubnetIP of my CSV file to get this result

Result :
Date, URL, IP ( it matches witch SubnetIP), CITY

Kind regards

Steve

0 Karma
1 Solution

splunkton
Path Finder

base search [|inputlookup lookup.csv|rename SubnetIP AS IP|table IP] --> it returns the results matching with the event and the lookup table

to derive city from the lookup table |lookup lookup.csv SubnetIP AS IP OUTPUT CITY

The total search query is going to be

base search [|inputlookup lookup.csv|rename SubnetIP AS IP|table IP]||lookup lookup.csv SubnetIP AS IP OUTPUT CITY | table Date URL IP City

View solution in original post

splunkton
Path Finder

base search [|inputlookup lookup.csv|rename SubnetIP AS IP|table IP] --> it returns the results matching with the event and the lookup table

to derive city from the lookup table |lookup lookup.csv SubnetIP AS IP OUTPUT CITY

The total search query is going to be

base search [|inputlookup lookup.csv|rename SubnetIP AS IP|table IP]||lookup lookup.csv SubnetIP AS IP OUTPUT CITY | table Date URL IP City

geantver0000
Engager

Indeed this search seems to works !
Really usefull thanks

Steve

0 Karma

sundareshr
Legend

Try this

... | lookup lokupfile.csv SubnetIP as IP OUTPUT City | table Date URL IP City
0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...