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!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...