Splunk Search

How to extract domain and top level domain?

moayadalghamdi
Path Finder

Dears

 

 I need your help in extracting the domain and top level domain from dns queries where:

 

Query Field                  |         extracted field

Account.fb.com         .         Fb.com

Aa.bb.cc.com              .         Cc.com

Www.google.com      .        Google.com

 

 

 

Thanks in advance 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| rex field=queryField ".*\.(?<extractedField>\w+\.\w+)"

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| eval extractedField=mvjoin(mvindex(split(queryField,"."),-2,2),".")
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex field=queryField ".*\.(?<extractedField>\w+\.\w+)"
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 ...