Splunk Search

How to extract the field value which has space

Anush
Engager

Below is the sample field value from the event, 

 sourceServiceName=Endpoint Web analyzedBy=Policy Engine Status=New Success=True

By default, the field value detects only Endpoint and not the full text Endpoint Web

Som I used the below rex command but it didn't work,

rex "sourceServiceName=(?<sourceServiceName>[^\"]+)"    - This one fetches all the text starting from "Endpoint to end of that event" 

Also the value of the field sourceServiceName can be anything, i.e -Endpoint Web or Endpoint Printing Endpoint USB  etc. First word -Endpoint Second word -any can any word

I want to fetch only the value of field serviceSourceName

Can you please help?

 

 

Labels (1)
0 Karma
1 Solution

isoutamo
SplunkTrust
SplunkTrust

Hi

you could try this

index=_internal
| head 1
| eval _raw = "sourceServiceName=Endpoint Web analyzedBy=Policy Engine Status=New Success=True Some=Other fields"
```Previous was set up the data, next one is the logic```
| rex "sourceServiceName=(?<sourceServiceName>[\w\s]+)\s+\w+="

r. Ismo 

View solution in original post

0 Karma

Anush
Engager

Thanks a lot. It worked

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

you could try this

index=_internal
| head 1
| eval _raw = "sourceServiceName=Endpoint Web analyzedBy=Policy Engine Status=New Success=True Some=Other fields"
```Previous was set up the data, next one is the logic```
| rex "sourceServiceName=(?<sourceServiceName>[\w\s]+)\s+\w+="

r. Ismo 

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...