Splunk Search

How to use the same lookup file for different fields?

dritjon
Path Finder

Let me be more clear: I have defined a lookup file (ip_lookup) which has two colums: IPHost and DNShost

Now I have a search which has two fields, src_ip and dest_ip. I successfully created a new field by using lookup like this:

index=fw_cisco | lookup ip_lookup IPHost as src_ip OUTPUT DNShost as resolved_source_ip

But I want to do the same for the field dest_ip too.  Doing lookup like this:  | lookup ip_lookup IPHost as src_ip, dest_ip ... throws an error

How do I create two new fields that match the src_ip and dest_ip of my events, from the same lookup command

Labels (2)
Tags (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=fw_cisco | lookup ip_lookup IPHost as src_ip OUTPUT DNShost as resolved_source_ip | lookup ip_lookup IPHost as dst_ip OUTPUT DNShost as resolved_destination_ip

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=fw_cisco | lookup ip_lookup IPHost as src_ip OUTPUT DNShost as resolved_source_ip | lookup ip_lookup IPHost as dst_ip OUTPUT DNShost as resolved_destination_ip
0 Karma

dritjon
Path Finder

thanks that worked

is there a way to do it with one lookup command?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Not for what you are trying to do - you can use multiple lookup fields but they would both have to match rows in the lookup file at the same time i.e. there would need to be both source and destination columns in your lookup file

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...