Skip to content

Instantly share code, notes, and snippets.

@gfdsa
Created September 26, 2017 09:08
Show Gist options
  • Save gfdsa/037768ea0c7a14f13ab304ead30f4dd7 to your computer and use it in GitHub Desktop.
Save gfdsa/037768ea0c7a14f13ab304ead30f4dd7 to your computer and use it in GitHub Desktop.
collect els conf
function getjson {
uri=$1
file=$2
[ ${uri: -1} == "&" ] && uri=${uri}pretty || uri=${uri}?pretty
curl -o ${file}.json -s $base$uri || { echo "Failed to curl $base$uri to ${file}.json"; exit 1; }
}
base="$1"
[ x$base == "x" ] && { echo "Provide a base url as argument 1"; exit 1; }
getjson "/_cluster/health" health
getjson "/_nodes/" nodes
for k in settings os process jvm thread_pool transport http plugins; do
getjson /_nodes/$k $k
done
getjson /_stats stats
getjson "/_shard_stores?status=green,yellow,red&" shard_stores
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment