graylog2-zabbix
graylog2-zabbix copied to clipboard
Json files are empty
Hi.
I had the problem that the json files after pull stay empty.
I checked everything and debugged the script.
The only thing I could fix ist was to replace the line 123
${CURL_BASE_CMD}${1} | jq '.' > $2
with a direct call of curl:
curl -u "$USERNAME":"$PASSWORD" -Ss "http://$HOSTNAME:$APIPORT/api$1" | jq '.' > $2
Don't know what the reason was, but now with " instead of ' and without ${} and wrap the url with " everything works.
Tried to put everything in the CURL_BASE_CMD var, but no success.
Maybe this helps someone.
Zabbix 3.2 Graylog 3.1 Debian 8.10 (Jessie) Bash 4.3.30
I had the same issue. Your solution solved the problem for me. Thank you.
Had the same issue, and adding eval to the line you describe fixed it for me:
eval "${CURL_BASE_CMD}${1} | cat | jq '.' > $2"
Bash is probably unable to evaluate the first argument ${1} without using eval.