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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...