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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...