From 7f8b0b855acb6c288f0a8d71c7e9b588cba1024e Mon Sep 17 00:00:00 2001 From: Mayte Ariza Date: Tue, 10 Mar 2020 13:37:33 +0100 Subject: [PATCH] Create .wazuh index before setting the API credentials (#312) --- elasticsearch/config/35-entrypoint_load_settings.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/elasticsearch/config/35-entrypoint_load_settings.sh b/elasticsearch/config/35-entrypoint_load_settings.sh index dc6b7756..a0ee6c90 100644 --- a/elasticsearch/config/35-entrypoint_load_settings.sh +++ b/elasticsearch/config/35-entrypoint_load_settings.sh @@ -165,6 +165,16 @@ echo "LOAD SETTINGS - Setting API credentials into Wazuh APP" CONFIG_CODE=$(curl -s -o /dev/null -w "%{http_code}" -XGET $el_url/.wazuh/_doc/1513629884013 ${auth}) if [ "x$CONFIG_CODE" != "x200" ]; then + + curl -s ${auth} -X PUT "$el_url/.wazuh/?pretty" -H 'Content-Type: application/json' -d' + { + "settings" : { + "number_of_shards" : 1, + "number_of_replicas" : 0, + "auto_expand_replicas": "0-1" + } + } + ' curl -s -XPOST $el_url/.wazuh/_doc/1513629884013 ${auth} -H 'Content-Type: application/json' -d' { "api_user": "'"$API_USER_Q"'",