Getting Data In

Split the URL by using splunk for getting count for the URL's with out special characters

kanamarlapudive
New Member

how to split URL's like below mentioned into one URL, how to do it in splunk sample URL

https://google.co.in/v4/locations/dfdfd
https://google.co.in/v4/locations/dfad

I would like to see https://google.co.in/v4/locations/ as 2

0 Karma
1 Solution

MathiasLindblom
Path Finder

Hi, have you tried extracting first part of the URL with a regex?
for example, if you have the URL extracted you could try:

<your search> | rex field=URL "(?P<URLpath>https:\/\/.*\/(?!\s))" | stats count by URLpath

This will grab everything exept the last part of the URL and count them as URLpaths.

View solution in original post

0 Karma

kanamarlapudive
New Member

Hi Mathias Lindblom,
thanks for the update.

0 Karma

MathiasLindblom
Path Finder

Hi, have you tried extracting first part of the URL with a regex?
for example, if you have the URL extracted you could try:

<your search> | rex field=URL "(?P<URLpath>https:\/\/.*\/(?!\s))" | stats count by URLpath

This will grab everything exept the last part of the URL and count them as URLpaths.

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