mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-10-29 02:53:33 +00:00
Ordening code, disable xpack ml feature at elastic. Also the features disabled at kibana are modified
This commit is contained in:
@@ -7,6 +7,8 @@ ENV ALERTS_SHARDS="1" \
|
||||
ENV API_USER="foo" \
|
||||
API_PASS="bar"
|
||||
|
||||
ENV XPACK_ML="false"
|
||||
|
||||
ENV TEMPLATE_VERSION=v3.8.2
|
||||
|
||||
ADD https://raw.githubusercontent.com/wazuh/wazuh/$TEMPLATE_VERSION/extensions/elasticsearch/wazuh-elastic6-template-alerts.json /usr/share/elasticsearch/config
|
||||
|
||||
@@ -68,4 +68,25 @@ curl -XPUT "$el_url/_cluster/settings" -H 'Content-Type: application/json' -d'
|
||||
}
|
||||
'
|
||||
|
||||
#Disabling xpack features
|
||||
|
||||
elasticsearch_config_file="/usr/share/elasticsearch/config/elasticsearch.yml"
|
||||
if grep -Fq "#xpack features" "$elasticsearch_config_file";
|
||||
then
|
||||
declare -A CONFIG_MAP=(
|
||||
[xpack.ml.enabled]=$XPACK_ML
|
||||
)
|
||||
for i in "${!CONFIG_MAP[@]}"
|
||||
do
|
||||
if [ "${CONFIG_MAP[$i]}" != "" ]; then
|
||||
sed -i 's/.'"$i"'.*/'"$i"': '"${CONFIG_MAP[$i]}"'/' $elasticsearch_config_file
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "
|
||||
#xpack features
|
||||
xpack.ml.enabled: $XPACK_ML
|
||||
" >> $elasticsearch_config_file
|
||||
fi
|
||||
|
||||
echo "Elasticsearch is ready."
|
||||
|
||||
Reference in New Issue
Block a user