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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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