Support Questions
Find answers, ask questions, and share your expertise
Alert: Please see the Cloudera blog for information on the Cloudera Response to CVE-2021-4428

Cloudera manager API json response as one line

Super Collaborator

Hi Guys,


I'm working to send the yarn applications meta data using the API to kibana,


But the API json response is pretty and kibana accepts the json as one line.


Below is one of the example i do, can anyone help me to know how to get this as one line?


curl -u 'xxxxx:'xxxxx' ''


Super Collaborator

Workaround would be to parse it in python/bash(tr,awk,sed)/perl to remove the line breaks, an easier option is to use ./jq -c -- see [0]


curl -s -X GET -u xxxxx:xxxxx http://cm-server:7180/api/v11/.... | jq -c



--compact-output / -c:

By default, jq pretty-prints JSON output. 
Using this option will result in more compact output by
instead putting each JSON object on a single line.