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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...