From 3f952be4c1821d3b7833fc52416a884239ecd0c8 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Wed, 19 Sep 2018 08:20:18 -0500 Subject: [PATCH] Fluent-logging: Update kubernetes plugin test This updates the kubernetes plugin test for fluent-logging to search across all indices instead of the default logstash-* index to account for custom indexes created for the events tagged with the kubernetes plugin. This also makes the search pattern for the tag more flexible to account for any arbitrary number of prefixes and/or suffixes added to the 'kube' tag as a result of any processing done in fluentd. Change-Id: Ib1a431cc8b2ca2cc143a8c8337b87f54f56d1029 --- fluent-logging/templates/bin/_helm-tests.sh.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluent-logging/templates/bin/_helm-tests.sh.tpl b/fluent-logging/templates/bin/_helm-tests.sh.tpl index e345ad411..74b13c4d9 100644 --- a/fluent-logging/templates/bin/_helm-tests.sh.tpl +++ b/fluent-logging/templates/bin/_helm-tests.sh.tpl @@ -36,7 +36,7 @@ function check_logstash_index () { # prefix via the fluent-kubernetes plugin function check_kubernetes_tag () { total_hits=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \ - -XGET "${ELASTICSEARCH_ENDPOINT}/logstash-*/_search?q=tag:kube.*" -H 'Content-Type: application/json' \ + -XGET "${ELASTICSEARCH_ENDPOINT}/_search?q=tag:**kube.**" -H 'Content-Type: application/json' \ | python -c "import sys, json; print json.load(sys.stdin)['hits']['total']") if [ "$total_hits" -gt 0 ]; then echo "PASS: Successful hits on logstash-* index, provided by fluentd!"