Splunk Search

How to extract everything after a carriage return?

ruhjuh
Explorer

Is it possible to get everything after a carriage return?

Example

Bills to pay:
Car
House
Boat
etc

I tried to use rex :

"[\r\n]+(?<Sites>.*)" 

but this did not work.

1 Solution

MuS
Legend

Hi ruhjuh,

try this regex:

base search here | rex "pay:[\r\n](?<site>[^$]+)" | table site

it will match Car House Boat etc from your example.

cheers, MuS

View solution in original post

MuS
Legend

Hi ruhjuh,

try this regex:

base search here | rex "pay:[\r\n](?<site>[^$]+)" | table site

it will match Car House Boat etc from your example.

cheers, MuS

ruhjuh
Explorer

That worked fantastically. Thanks.

0 Karma

MuS
Legend

What do you want to get from the provided example?

0 Karma

ruhjuh
Explorer

I'd like to get from the example "Car House Boat etc"

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...