Dashboards & Visualizations

Display table with field values having spaces

Nidd
Path Finder

I have a field named Source which contains spaces.
eg:

index=myIndex |Source=My Source Value|ComponentValue=My Component Value

To make this field displayed in a table, I used the following command.

rex "Source=(?<Source>[\S\s]*),{15}"

For which, I get

-----------------------
Source
-----------------------
My
My Source Value
My
My

If I'm doing like:

rex "Source=(?<Source>[\S\s]*)" | table Source | rename Source as source

I get the value I require, but also the entire log as well.

i.e:

-----------------------
Source
-----------------------
My Source Value
index=myIndex |Source=My Source Value|ComponentValue=My Component Value

My Source Value
index=myIndex |Source=My Source Value|ComponentValue=My Component Value

Can someone please help how to achieve this?

Tags (1)
0 Karma

arjunpkishore5
Motivator

Are you trying to extract the value of Source from the following text ? "|Source=My Source Value|ComponentValue=My Component Value" If yes, use this

| rex field=_raw "Source=(?<Source>[^|]+)"

Hope this helps.

Cheers

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Nidd

Try | rex "Source=(?<Source>[\S\s]*)\|"

Example:

| makeresults 
| eval _raw=" index=myIndex |Source=My Source Value|ComponentValue=My Component Value" 
| rex "Source=(?<Source>[\S\s]*)\|"
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 ...