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.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...