Splunk Search

Parsing Results with spaces

jaydiare
Explorer

I have this output from a field, with a lot of blank spaces,  what would it be the best way to convert this data into a table? or maybe a regex to parse it out better

Start

TREATMENTING ROUTES. TREATMENTS IS: GNCT
 
1 T12023
 
2 LKOUTWDF
 
POSITIONS ROUTES. POSITIONS IS: TOPS
 
1 CGHBRAB21053TBX
 
N S3T55NS
 
End.
Labels (2)
0 Karma

jaydiare
Explorer

jaydiare_0-1638467123914.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

From this event, what would you like to see in the table?

0 Karma

jaydiare
Explorer

no spaces from the top or the bottom 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex mode=sed "s/(?ms)^\s+$\n?//g"
0 Karma

jaydiare
Explorer

Start and End are not part of the output  🙂

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What about how the table should look and other (sample) events?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

I assume this field is from one event? Does it include the "Start" and "End."? What would you like to see in the table? Can you share other events or are they all like this i.e. same number of lines, same headings, etc.?

0 Karma
Get Updates on the Splunk Community!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...