Splunk Search

Need a help in creating a dashboard to get information on the IP address?

Hemnaath
Motivator

Hi, I got a request to create a dashboard to get the information on the ipaddress, with multiple panels and one input text tokens, another with Time Picker. One of the Dashboard panel output should contain Hostname (resolved by dns lookup).
I was referring the below link to understand

https://answers.splunk.com/answers/105246/dns-resolution-in-a-search.html

But unable understand the query referred in the link. I mean What search string should be placed before the pipe symbol?

| lookup dnslookup clientip as dst OUTPUT clienthost as DST_RESOLVED

Could anyone guide me on the query which can fetch the Hostname (resolved by dns lookup).

Tags (2)
0 Karma

solarboyz1
Builder

The query required depends on your data, and the field that contains the information you require.

In the example:

| lookup dnslookup clientip as dst OUTPUT clienthost as DST_RESOLVED

The even generating search, is returning a dst field, which is being resolved the resolved value is being stored in the field DST_RESOLVED

0 Karma

Hemnaath
Motivator

Thanks for your response, hey I had tried the below query to fetch the resolved IP address as the Hostname

Query details:

dest="10.x.x.*" | stats count by dest |  lookup dnslookup clientip as dest OUTPUT clienthost as Hostname | dedup dest Hostname | table dest Hostname

I am getting the resolved IP address with the corresponding Hostname.

dest            Hostname
10.x.x.x    vmw1dev8.xxxxx.com

But when same was query is applied to the dashboard panels it is not working. In dashboard we have two input fields one input text tokens (Ip address) and another with Time Picker.

Token for input text field is defined as "$D$"
Token for Time Picker drop down is defined as "$T$"
Search on change option is checked and for time picket shared time picker option is selected.

Query in the dashboard panels.

dest="$D$" | stats count by dest |  lookup dnslookup clientip as dest OUTPUT clienthost as Hostname | dedup dest Hostname | table dest Hostname

And In dashboard I could see this

search is waiting for input ....

Can you please guide on this to fix this issue.

0 Karma

Hemnaath
Motivator

hey when tried to edit and execute the query in open search, I am getting a "undefined" in the search. So can any guide me on this to fix this.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...