Dashboards & Visualizations

parsing URL regex

asdfxqwert
Explorer

I need help with regex for parsing a URL

 

The URL can be  a/b/c, a/b/c/d or a/b/c/d/e

In any case I need the resource of the URL -  c d e respectively for the above URLs. Can you help with a regex which can give the value after the last / 

 

Labels (1)
Tags (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

See the rex statement here

| makeresults
| eval urls=split("a/b/c,a/b/c/d,a/b/c/d/e",",")
| mvexpand urls
| rex field=urls ".*/(?<resource>.*)"

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

See the rex statement here

| makeresults
| eval urls=split("a/b/c,a/b/c/d,a/b/c/d/e",",")
| mvexpand urls
| rex field=urls ".*/(?<resource>.*)"
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...