Splunk Search

How to write the regex to pull out the file name after the last / at the end of a log?

akelly4
Path Finder

I have the following line in a log and i'm trying to pull out the file name at the end. How do I use regex to pull everything after the last /?

URL: http://testing.tester.com/pub/info/test/archive/fp_13.0.0.2fsf_test.zip

I was trying rex "URL: ^\/" but it doesn't seem to be working.

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This worked for me in RegExr:

"URL: .*[/](?<filename>.*)"
---
If this reply helps you, Karma would be appreciated.
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, ...