Splunk Search

How to extract the last file name from my sample string of data?

jclemons7
Path Finder

Hello all,

I have the following string:

"6900   0   1024        0   0   0   0   0   0   0   C:\windows\System32\Launcher.exe    "C:\windows\System32\Launcher.exe" "C:\Folder\Link - Shortcut.lnk"  ",

And I need a way to get the very last part (e.g.. Shortcut.lnk). Normally I would use regex for this in SQL or code, but for the life of me, I can't figure out how to implement it in Splunk.

Any help is greatly appreciated..

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Splunk does regex, too. Assuming your text is already extracted, this should pull out the last part. I've made other assumptions about the characters that start and end the desired text so you may need to adjust the regex.

... | rex field=text "- (?<shortcut>[^\"]*)" | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

bmacias84
Champion

Can you provide a few more samples?

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...