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!

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...