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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...