From 42b71c83d9eff7c2e0a990198d572476a8ed85e2 Mon Sep 17 00:00:00 2001 From: neu5ron Date: Mon, 20 May 2019 18:58:54 -0400 Subject: [PATCH] add cluster settings --- .../scripts/logstash-entrypoint.sh | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docker/helk-logstash/scripts/logstash-entrypoint.sh b/docker/helk-logstash/scripts/logstash-entrypoint.sh index a8e8be9..ab2e796 100755 --- a/docker/helk-logstash/scripts/logstash-entrypoint.sh +++ b/docker/helk-logstash/scripts/logstash-entrypoint.sh @@ -79,6 +79,48 @@ for file in ${DIR}/*.json; do done done +# ******** Cluster Settings *************** +echo "[HELK-ES-DOCKER-INSTALLATION-INFO] Configuring elasticsearch cluster settings.." +while true; do + if [[ -n "$ELASTIC_PASSWORD" ]]; then + STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u $ELASTIC_USERNAME:$ELASTIC_PASSWORD $ELASTICSEARCH_URL) + if [ $STATUS -eq 200 ]; then + curl -u $ELASTIC_USERNAME:$ELASTIC_PASSWORD -XPUT $ELASTICSEARCH_URL/_cluster/settings -H 'Content-Type: application/json' -d' + { + "persistent": { + "search.max_open_scroll_context": 15000, + "indices.breaker.request.limit" : "70%" + }, + "transient": { + "search.max_open_scroll_context": 15000, + "indices.breaker.request.limit" : "70%" + } + }' + break + else + sleep 1 + fi + else + STATUS=$(curl -s -o /dev/null -w '%{http_code}' $ELASTICSEARCH_URL) + if [ $STATUS -eq 200 ]; then + curl -XPUT $ELASTICSEARCH_URL/_cluster/settings -H 'Content-Type: application/json' -d' + { + "persistent": { + "search.max_open_scroll_context": 15000, + "indices.breaker.request.limit" : "70%" + }, + "transient": { + "search.max_open_scroll_context": 15000, + "indices.breaker.request.limit" : "70%" + } + }' + break + else + sleep 1 + fi + fi +done + # ********** Install Plugins ***************** echo "[HELK-LOGSTASH-DOCKER-INSTALLATION-INFO] Checking Logstash plugins.." # Test a few to determine if probably all already installed