ci: Always search in explicit index pattern

This commit is contained in:
Antoine Cotten 2021-08-27 00:32:16 +02:00
parent f3940477f9
commit c8fc437bdb
No known key found for this signature in database
GPG Key ID: 94637E68D4A79DD0
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ curl -X POST "http://${ip_es}:9200/_refresh" -u elastic:testpasswd \
-s -w '\n' -s -w '\n'
log 'Searching message in Elasticsearch' log 'Searching message in Elasticsearch'
response="$(curl "http://${ip_es}:9200/_count?q=message:dockerelk&pretty" -s -u elastic:testpasswd)" response="$(curl "http://${ip_es}:9200/logstash-*/_count?q=message:dockerelk&pretty" -s -u elastic:testpasswd)"
echo "$response" echo "$response"
count="$(jq -rn --argjson data "${response}" '$data.count')" count="$(jq -rn --argjson data "${response}" '$data.count')"
if [[ $count -ne 1 ]]; then if [[ $count -ne 1 ]]; then

View File

@ -32,7 +32,7 @@ declare -i count
# retry for max 60s (30*2s) # retry for max 60s (30*2s)
for _ in $(seq 1 30); do for _ in $(seq 1 30); do
response="$(curl "http://${ip_es}:9200/_search?q=docker.image:%22docker-elk_logspout%22%20AND%20message:%22logspout%20gliderlabs%22~3&pretty" -s -u elastic:testpasswd)" response="$(curl "http://${ip_es}:9200/logstash-*/_search?q=docker.image:%22docker-elk_logspout%22%20AND%20message:%22logspout%20gliderlabs%22~3&pretty" -s -u elastic:testpasswd)"
set +u # prevent "unbound variable" if assigned value is not an integer set +u # prevent "unbound variable" if assigned value is not an integer
count="$(jq -rn --argjson data "${response}" '$data.hits.total.value')" count="$(jq -rn --argjson data "${response}" '$data.hits.total.value')"