Splunk Search

Splunk search help: formatting a field

premvenud
New Member

Can somebody help me with a Splunk query to format the below MESSAGE field value

  • MESSAGE=ABC-STATUS-COUNT={\"false\":1,\"true\":1}\n

as something like below

  • MESSAGE=ABC-STATUS-COUNT-{false:1,true:1}
0 Karma

somesoni2
Revered Legend

You can do like this (runanywhere search, replace line1 with your search)

| gentimes start=-1 | eval MESSAGE="ABC-STATUS-COUNT={\\\"false\\\":1,\\\"true\\\":1}\\n" 
| rex field=MESSAGE mode=sed "s/\\\[\"\w]//g"
Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...