Getting Data In

How can I extract Hostname Field via IP address in event info from .csv lookup?

adam_dixon95
Explorer

Hi,

I'm looking at alerting on SNMP traps in Splunk and one thing that I need to do is to be able to lookup the hostname from the IP address listed in the event - the hostname will be pulled via a .csv.

The csv has the following columns with data populated underneath:

customer_hostname,customer_IP

SNMP trap information shows the customer IP address of the device, but I need the hostname to be pulled from the .csv and added to a field/event info so we can see the hostname clearly.

Any information on how to this would be greatly appreciated.

gcusello
SplunkTrust
SplunkTrust

Hi,

If you have a lookup with IPs and hostnames you can use the lookup command:

Your_search
| lookup my_lookup.csv IP OUTPUT hostname
| ...

If instead you can access the DNS you can use the dnslookup command.

Bye.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...