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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...