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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...