From b83762eaa817e57c991acbb9c7acc43e0ff4044f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Wenzel?= Date: Mon, 30 Mar 2020 09:14:35 +0200 Subject: [PATCH] fix iteration for ec2 instances --- discovery.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery.sh b/discovery.sh index 6ccf40a..2c22f47 100755 --- a/discovery.sh +++ b/discovery.sh @@ -13,7 +13,7 @@ #### Currently it takes only privateIpAddress, this can be changed to a non privateIpAddress #### [ {"PrivateIpAddress": "", "Tags": [{"Key": "", "Value": ""}] } ] -instances=$(aws ec2 describe-instances --filters 'Name=tag-key,Values=prom/scrape*' --query "Reservations[*].Instances[*].{PrivateIpAddress:PrivateIpAddress,Tags:Tags}" --output json | jq '.[0] // []') +instances=$(aws ec2 describe-instances --filters 'Name=tag-key,Values=prom/scrape*' --query "Reservations[*].Instances[*].{PrivateIpAddress:PrivateIpAddress,Tags:Tags}" --output json | jq 'flatten // []') fileSdConfig="[]"