Splunk Search

How Do I Obtain the Valid Part of DNS Logs?

dickens8866
New Member

Dear All,

I'm trying to retrieve and parse windows dns log, the sample looks like this:


1/23/2020 11:59:42 PM 0B50 PACKET 000001F5A879FCD0 UDP Snd 10.231.150.89 b40e R Q [8081 DR NOERROR] A (3)www(15)msftconnecttest(3)com(0)

After installed plunk Add-on for Microsoft Windows DNS , it can automatically extract filed query = (3)www(15)msftconnecttest(3)com(0). But the query name looks very strange, the real name should be www.msftconnecttest.com.

So my question is , how to parse or transform the query name into correct format. maybe need to write some regular expression
or something, but i'm not good at it.

Tags (1)
0 Karma
1 Solution

nickhills
Ultra Champion

Not tested, but you could try:

|eval fixedDNS = replace(badDns, "\(\d+\)","\.")
Where badDNS is the field that contains "(3)www(15)msftconnecttest(3)com(0)"

If my comment helps, please give it a thumbs up!

View solution in original post

0 Karma

nickhills
Ultra Champion

Not tested, but you could try:

|eval fixedDNS = replace(badDns, "\(\d+\)","\.")
Where badDNS is the field that contains "(3)www(15)msftconnecttest(3)com(0)"

If my comment helps, please give it a thumbs up!
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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