Splunk Search

resolve IP to name

gburtz
New Member

I want to be able to see the host name in search results rather than IP. In this case, the "host" I am looking for is the name of the firewall, router, or switch sending the log message. The host names have been added to our DNS servers and nslookup returns the correct info. Any ideas on how to do this??

 

Thanks..

Labels (1)
0 Karma

radam2000
Path Finder

In my fw queries, I use two lookups in my queries, one to a lookup file that I created and manage called server_ip_lookup... and then a second one that does a dns lookup on source and destination

index="internetfirewalls" AND sourcetype="cisco:asa"

|lookup server_ip_lookup IPAddress as src_ip
output DeviceName as "Src_Device"
|lookup server_ip_lookup IPAddress as dest_ip
output DeviceName as "Dest_Device"

|stats count by dest_ip, Dest_Device, dest_port, src_ip, Src_Device, action, rule_id, transport
|sort -count

|lookup dnslookup clientip as src_ip OUTPUT clienthost as Src_Resolved
|lookup dnslookup clientip as dest_ip OUTPUT clienthost as Dest_Resolved
| eval Src_Device = if(Src_Device="-", Src_Resolved, Src_Device)
| eval Dest_Device = if(Dest_Device="-", Dest_Resolved, Dest_Device)
|table count, transport, src_ip, Src_Device, dest_ip, Dest_Device, dest_port, action, rule_id

 

0 Karma
Get Updates on the Splunk Community!

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...