Splunk Search

regular expression for multi lineevent

darksky21
Path Finder

Hi i have an event

Filename : 1.htm
Content Type : text/html; charset=utf-8

how can i extract the (1.htm only)
i tried ending the string with space but the regex still give me (1.htm Content Type : text/html; charset=utf-8)

sorry new to regex

Tags (1)
0 Karma

kristian_kolb
Ultra Champion

Hi

... | rex  "(?m)Filename\s+:\s+(?<file_name)[^\r\n]+)"

Should work. If you're happy, then you can put it in props.conf to make it more permanent;

[your_sourcetype]
EXTRACT-blah =  (?m)Filename\s+:\s+(?<file_name)[^\r\n]+)

Ayn
Legend

...well what's the regex you're using?

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...