Splunk Search

maping a client name resolution search result to an IP address at the time of name resolution

mpasha
Path Finder

Good day,
I am trying to create a search that can first search DNS for a certain domain name and after if finds a match takes the Client IP address and search the DHCP logs for the client computer name and Mac address. point is the time for the DHCP search must be the time the DNS record was found or earlier. let me give you an example:
1- i am looking for any client that has a query for "hola.com"
2- there are 10 hits each with different times
3- i want to return the source IP address "which is the Client IP address searching for Hola" and go to DHCP logs and search for the Client name and Mac address of the user at the time he/she was resolving hola.com. so the time Latest=Time found on DNS entry and earliest=Time found on DNS entry-1day.
here is a search i have been trying to run with no luck:

index=dhcp (Action=Renew OR Action=Assign)
| eval Search_Time_From=relative_time(Time_detected,"-1d")
| where earliest=Search_Time_From AND latest=Time_detected [search eventtype=dnsout DNS_Query="*hola*" |dedup Client_IP consecutive=true
    | eval Time_detected =_time
    | fields Time_detected Client_IP]|lookup Computers MACAddress as MAC_Address Outputnew|lookup Users Logon_Name as UserID OUTPUTnew |dedup Client_IP Action consecutive=true |table _time host ServerLoc_Time Client_Name Client_IP MAC_Address UserID Display_Name Action

Thanks for your help

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...