Skip to content

Commit

Permalink
Modified script to fetch services from docker-compose file and metric…
Browse files Browse the repository at this point in the history
…s dynamically
  • Loading branch information
sweep-ai[bot] authored Aug 12, 2023
1 parent 8af38b5 commit 6b7e553
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/generate_compatibility_table.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/bash

compatibilityTable="| Logstash Version | Metric 1 | Metric 2 | Metric 3 |\n|------------------|----------|----------|----------|\n"
compatibilityTable="| Logstash Version "
metrics=$(curl -s "http://localhost:9600/_node/stats" | jq -c '.data[] | select(.metric | startswith("logstash"))')
for metric in $metrics; do
metricName=$(echo "$metric" | jq -r '.metric')
compatibilityTable+="| $metricName "
done
compatibilityTable+="\n|------------------"
for metric in $metrics; do
compatibilityTable+="|----------"
done
compatibilityTable+="\n"

for service in $(docker service ls --format "{{.Name}}"); do
for service in $(grep 'logstash_' docker-compose-compatibility.yml | cut -d ':' -f 1 | tr -d ' '); do
if [[ $service == logstash_* ]]; then
version=${service#logstash_}
compatibilityTable+="| $version"
Expand Down

0 comments on commit 6b7e553

Please sign in to comment.