Splunk Search
Highlighted

DNS Resolution in a search

Communicator

Is it possible to have ip addresses in a search resolved to a host name and displayed in the results rather then the ip address. My search is:

source="udp:514" "dst=192.168." | stats count by dst | sort -count limit=10

This gives me the top ten hit ip addresses. I would like to see the host name rather than (or as well as) the ip address. Can this be done as part of the search string?

Tags (2)
Highlighted

Re: DNS Resolution in a search

Splunk Employee
Splunk Employee
Highlighted

Re: DNS Resolution in a search

Communicator

The transforms.conf files did the trick and with a little manipulation of the search I have the results I wanted.

Thanks.

Highlighted

Re: DNS Resolution in a search

Super Champion

Yes. But you will need a lookup table that matches the IP address to the host name.

Depending on the apps you have installed, you may find that this lookup table already exists. If it does already exist you will find it in the lookup folder, and it will automatically populate a field in which case you simply need to add the field to your stats. The name of the field escapes me.

0 Karma
Highlighted

Re: DNS Resolution in a search

Splunk Employee
Splunk Employee

Actually, the answers entries I linked to are for using an external command that performs the lookup on the fly and responds with the results.

0 Karma
Highlighted

Re: DNS Resolution in a search

Super Champion

You answered at the same time I did. Besides, if they are already there...

0 Karma
Highlighted

Re: DNS Resolution in a search

Path Finder

There is no need to create a lookup table as long as the nameserver holds those records. Just use the following after your example search:

<search> | lookup dnslookup clientip as dst OUTPUT clienthost as DST_RESOLVED

View solution in original post

Highlighted

Re: DNS Resolution in a search

Engager

perfect, thanks for this solution - works perfectly

Highlighted

Re: DNS Resolution in a search

Esteemed Legend

You should click "Accept" to close the question.

0 Karma
Highlighted

Re: DNS Resolution in a search

Engager

this query has worked for me "lookup dnslookup clientip as lsp_rro OUTPUT clienthost as hops" when trying to make a human readable LSP path. We use /etc/hosts for the IP to hostname lookup, you can also use a DNS server to fill this requirement such as BIND9, MS Server or dnsmasq to name a few.

0 Karma