From b2fd5f527c81580402501c85545bb666a574ca88 Mon Sep 17 00:00:00 2001 From: ddragosd Date: Mon, 7 Sep 2015 01:05:25 -0700 Subject: [PATCH] Fixes #1 Updated curl command to request `text/plain` --- init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.sh b/init.sh index 2c698c2..e9fb869 100755 --- a/init.sh +++ b/init.sh @@ -49,7 +49,7 @@ if [[ -n "${marathon_host}" ]]; then # ASSUMPTION: there is a graphite app named "api-gateway-graphite" deployed in marathon # while true; do \ - statsd_host=$(curl -s ${marathon_host}/v2/apps/api-gateway-graphite/tasks | grep 8125 | awk '{for(i=3;i<=NF;++i) printf("%s ", $i) }' | awk '{for(i=1;i<=NF;++i) sub(/\:\d+/,"",$i); print }' ); \ + statsd_host=$(curl -s ${marathon_host}/v2/apps/api-gateway-graphite/tasks -H "Accept:text/plain" | grep 8125 | awk '{for(i=3;i<=NF;++i) printf("%s ", $i) }' | awk '{for(i=1;i<=NF;++i) sub(/\:\d+/,"",$i); print }' ); \ if [[ -n "${statsd_host}" ]]; then python /etc/api-gateway/scripts/python/logger/StatsdLogger.py --statsd-host=${statsd_host} > /var/log/api-gateway/statsd-logger.log; fi; \ sleep 6; \ done &