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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...