Skip to content

Commit 75fc05c

Browse files
committed
Fix: Output JSON raw for unformatted redirection to file
1 parent e20a960 commit 75fc05c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nginx-utils/api_stats.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ if [ -z "${API_PORT}" ]; then
2828
exit 1
2929
fi
3030

31-
api_versions=($(curl http://127.0.0.1:$API_PORT/api/ | sed -e 's/\[//g' -e 's/\]//g' -e 's/\,/ /g'))
31+
api_versions=($(curl -s http://127.0.0.1:$API_PORT/api/ | sed -e 's/\[//g' -e 's/\]//g' -e 's/\,/ /g'))
3232
API_VERSION=${api_versions[-1]}
3333
echo "API_VERSION: $API_VERSION"
3434

3535
echo "**** /api/$API_VERSION/nginx ****" ;
36-
curl -s "127.0.0.1:$API_PORT/api/$API_VERSION/nginx" | jq .;
36+
curl -s "127.0.0.1:$API_PORT/api/$API_VERSION/nginx" | jq -r '.';
3737
echo "";
3838

3939
for i in /api/$API_VERSION/processes /api/$API_VERSION/connections /api/$API_VERSION/slabs /api/$API_VERSION/http/requests /api/$API_VERSION/http/server_zones /api/$API_VERSION/http/location_zones /api/$API_VERSION/http/caches /api/$API_VERSION/http/upstreams /api/$API_VERSION/http/keyvals; do
4040
echo "**** $i ****" ;
41-
curl -s "127.0.0.1:$API_PORT/$i" | jq .;
41+
curl -s "127.0.0.1:$API_PORT/$i" | jq -r '.';
4242
echo "";
4343
done

0 commit comments

Comments
 (0)