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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...