Splunk Search

How to extract a string from a field that contains space characters?

talbs
New Member

Hello,

I would like to extract a string from a field which contains Space characters.
This is the Text Field that is already extracted:

<Text>Launched application: FilmView, PID: 5180</Text>

I used the following search:

rex field=Text ": (? Application> \w+) ,"

I didn't work for me. What should be the right command?
If it can be done, I would like to extract the PID field as well.

Thanks

0 Karma

javiergn
Super Champion

Try this:

| rex field=Text "application: (?<Application>[^\,]+)\, PID: (?<PID>\d+)"
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...