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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...