Splunk Search

Remove everything after .com in website

N5535
Loves-to-Learn Everything

Is there a simple way to remove everything after website.com

Currently I have several urls imported into splunk, some of which has full paths following .com

Currently:Would like it to be:
firstwebsite.com/websitefirstwebsite.com
secondwebsite.comsecondwebsite.com
thirdwebsite.com/jigiiit/jjejjrejrthirdwebsite.com
fourthwebsite.com/hjehfourthwebsite.com

 

Any pointers would be great!

Labels (2)
0 Karma

mayurr98
Super Champion

try this:

 

 

| rex field=url_field "http(|s):\/\/(?<url>[^\/]+)"

 

Tags (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @N5535,

Please try below;

| rex field=url_field "^(?<cleaned_url>[^\/]+)"
| table url_field cleaned_url
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

N5535
Loves-to-Learn Everything

@scelikok ,

I should have mentioned that there is https:// in front of the url's.

My results are 

https://

https://

https://

https://

0 Karma
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 ...