Splunk Search

Can you help me make a regular expression to extract a field?

x213217
Explorer

Hello,

I have these events where I want to extract a filename. Right now, none of the fields capture the Filename("this is what i want to capture") as a field. Using the regex or delimiter generators from Splunk to produce a new field are not giving me good results, so I believe it is best to write one.

Basically, what i want is the information inside the quotes of FileName("") for each event. I indicate it with a red line.

alt text

0 Karma
1 Solution

chrisyounger
SplunkTrust
SplunkTrust

Try this:

YOUR SEARCH|rex "Filename\(\"(?<my_filename>[^\"]+)"

This should create a new file called my_filename

View solution in original post

chrisyounger
SplunkTrust
SplunkTrust

Try this:

YOUR SEARCH|rex "Filename\(\"(?<my_filename>[^\"]+)"

This should create a new file called my_filename

x213217
Explorer

Thank you! works

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...