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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...