Splunk Search

Matching Hostname to IP Between Two Lookups?

atebysandwich
Path Finder

I have two lookups. One lookup has Hostnames and IPs and the other has hostnames. I would like to run a search so I can take second lookup and see if its hostname is in the first, and if it is, show the hostname and the IP in the search results. 

Labels (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If I understand the matter right, this should get you started.

| inputlookup lookup2
| lookup lookup1 hostname
| where isnotnull(ip)
| table hostname ip
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

If I understand the matter right, this should get you started.

| inputlookup lookup2
| lookup lookup1 hostname
| where isnotnull(ip)
| table hostname ip
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...