ci: Always search in explicit index pattern
This commit is contained in:
parent
f3940477f9
commit
c8fc437bdb
|
@ -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
|
||||||
|
|
|
@ -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')"
|
||||||
|
|
Loading…
Reference in New Issue