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.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...