All Apps and Add-ons

Collect generates extra characters to JSON output

evelenke
Contributor

Hi Splunkers,

I use command curl (Curl Command app) to poll records from JSON array. I need this data in index, so I use command collect. After indexing the JSON get additional characters - every quotation (") gets backslash (\) before. Also it adds informational text at the first raw. This brokes standard JSON into something unhandy.
Is there any way to escape this?

alt text

0 Karma

nickhills
Ultra Champion

Thats how collect works, its primaraly for summary indexing, which is why the other metadata gets added.
The \'s are added to escape the quotes, but only in _raw. As your example shows when you table response its formatted correctly.

If you want to extract the json values from the summary data use spath:
...your search|spath input=response

If my comment helps, please give it a thumbs up!
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...