Splunk Search

Resolve only the top 10 clientips in DNS

jstockamp
Communicator

I'm trying to figure out the best way to have splunk resolve hostnames for only the top 10 clientips (by MB's transferred) from my access-combined logs. I've got the reverse DNS lookup working, and so for I've created the following search string:

eventtype="myevents" | eval MB = bytes/1024/1024 | chart sum(MB) as TotalMB by clientip | sort -TotalMB | head 10 | lookup dnsLookup ip as clientip | eval hostname=coalesce(host,clientip) | table hostname, TotalMB

I don't believe this is doing what I want though, it looks like its still trying to resolve all the clientip's, not just the top 10. What am I doing wrong here?

Tags (2)
0 Karma

ziegfried
Influencer

I'm quite sure it's only resolving the top 10 results, but it's doing this in preview mode. So it's executing the lookup with the partial results multiple times until the search is finished.

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...