Splunk Search

Can you help me build the regex that would extract a filename without filenamenumber and extension?

ugruner
Explorer

Hi,

i am not familiar with regex and am trying to extract only the filename from the following data without the number at the end:

myfile2.txt
myfileagain.doc
myfile33.txt

to

myfile
myfileagain
myfile

REGEX=(\bmy\w\D+) was my first idea, but I had no luck.

Can you give me a tip on how to solve this?

Regards
Udo

Tags (2)
0 Karma

FrankVl
Ultra Champion

Try something like this:
(?<filename>[a-zA-Z]+)\d*\.\w+

https://regex101.com/r/rAObpF/2

Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...