mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-11-03 21:43:17 +00:00
add race condition for wazuh alerts template
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
##############################################################################
|
||||
# Waiting for elasticsearch
|
||||
##############################################################################
|
||||
|
||||
if [ "x${ELASTICSEARCH_URL}" = "x" ]; then
|
||||
el_url="http://elasticsearch:9200"
|
||||
else
|
||||
@@ -19,6 +23,23 @@ sleep 10
|
||||
>&2 echo "Elasticsearch is up."
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Waiting for wazuh alerts template
|
||||
##############################################################################
|
||||
|
||||
strlen=0
|
||||
|
||||
while [[ $strlen -eq 0 ]]
|
||||
do
|
||||
template=$(curl $el_url:9200/_cat/templates/wazuh -s)
|
||||
strlen=${#template}
|
||||
done
|
||||
|
||||
sleep 10
|
||||
|
||||
>&2 echo "Wazuh alerts template is load."
|
||||
|
||||
|
||||
./wazuh_app_config.sh
|
||||
|
||||
sleep 5
|
||||
|
||||
@@ -26,11 +26,28 @@ sleep 10
|
||||
|
||||
>&2 echo "Elasticsearch is up."
|
||||
|
||||
##############################################################################
|
||||
# Waiting for wazuh alerts template
|
||||
##############################################################################
|
||||
|
||||
strlen=0
|
||||
|
||||
while [[ $strlen -eq 0 ]]
|
||||
do
|
||||
template=$(curl $el_url:9200/_cat/templates/wazuh -s)
|
||||
strlen=${#template}
|
||||
done
|
||||
|
||||
sleep 10
|
||||
|
||||
>&2 echo "Wazuh alerts template is load."
|
||||
|
||||
##############################################################################
|
||||
# Customize logstash output ip
|
||||
##############################################################################
|
||||
|
||||
if [ "$LOGSTASH_OUTPUT" != "" ]; then
|
||||
echo "Customize Logstash ouput ip."
|
||||
>&2 echo "Customize Logstash ouput ip."
|
||||
sed -i "s/elasticsearch:9200/$LOGSTASH_OUTPUT:9200/" /usr/share/logstash/pipeline/01-wazuh.conf
|
||||
sed -i "s/elasticsearch:9200/$LOGSTASH_OUTPUT:9200/" /usr/share/logstash/config/logstash.yml
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user