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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...