Splunk Search

Do two joins matching inputlookup data to build table

yacht_rock
Explorer

I have a lookup - ips.csv - formated like...

ip,name
1.2.3.4,server1
2.3.4.5,server2

My indexed data is source, destination. I want a table that is like...

source, source_name, destination, destination_name

Not all sources or destinations will have a name in the lookup, so I want to see all rows, even if there is no name...

source, source_name, destination, destination_name
1.2.3.3,server,8.8.8.8,-
2.3.4.5,server2,4.4.4.4,client3

index=foo | table source destination | rename source AS ip | join [|inputlookup ips.csv | fields ip name] | rename ip AS source name AS source_name | rename destination AS ip | join [|inputlookup ips.csv | fields ip name]  rename ip AS destination name AS destination_name | table source source_name destination destination_name

Never seems to complete. I also get an error about renaming fields too many times.

I've experimented with join, append, appendcols... with no luck. How can I build this table?

Tags (2)
0 Karma

woodcock
Esteemed Legend

Like this:

index=foo 
| dedup source destination
| table source destination
| lookup jps.csv ip AS source OUTPUT name AS source_name 
| lookup jps.csv ip AS destination OUTPUT name AS destination_name
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...