Splunk Search

How to extract and display in a table form?

Manth
Explorer

I have splunk logs as given below. However, I wanted display fields in between square brackets "[ ]" in a table as given below. Please advise.

Expeted query result in a table

sqsMsgId                                                                        | snsMsgId                                                                        | requestId

dec6c564-9e1c-4d0f-8e5e-ac9dc7bdf14a  | 7d81b4cf-43c0-5bb4-8370-ef064a78da16 | d487108c-863f-5ab2-96df-4b458f97c74e

My splunk Logs

{"level":"info","message":"[sqsMsgId=dec6c564-9e1c-4d0f-8e5e-ac9dc7bdf14a | snsMsgId=7d81b4cf-43c0-5bb4-8370-ef064a78da16 | workItemKey=CAMP:MI4:ORG_ID:103857:7fbf0f46-4131-404d-9a13-57cdff7c473a | requestId=d487108c-863f-5ab2-96df-4b458f97c74e | status=SUCCESS | ags=CAMP | component=MI4 | duration=383]","requestId":"d487108c-863f-5ab2-96df-4b458f97c74e"}

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex "sqsMsgId=(?<sqsMsgId>\S+)\s.*?snsMsgId=(?<snsMsgId>\S+)\s.*?requestId=(?<requestId>\S+)\s"
0 Karma

Manth
Explorer

Thank you for your quick response. However, I would like to display key value fields in table where field delimiter is "|" and key-value delimiter is "=". Please advise.

0 Karma

johnhuang
Motivator
<base_search>
| rex "^[^\[]*\[(?<_raw>[^\]]*)"
| extract pairdelim="|" kvdelim="="
0 Karma
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...