forked from wazuh/wazuh-docker
Include protocol and port in LOGSTASH_OUTPUT environment variable (#164)
* Including protocol and port in the LOGSTASH_OUTPUT env var.
This commit is contained in:
committed by
manuasir
parent
92b2814fb1
commit
f63d9fa387
@@ -17,6 +17,16 @@ else
|
|||||||
el_url="${ELASTICSEARCH_URL}"
|
el_url="${ELASTICSEARCH_URL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Customize logstash output ip
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
if [ "$LOGSTASH_OUTPUT" != "" ]; then
|
||||||
|
>&2 echo "Customize Logstash ouput ip."
|
||||||
|
sed -i 's|elasticsearch:9200|'$LOGSTASH_OUTPUT'|g' /usr/share/logstash/pipeline/01-wazuh.conf
|
||||||
|
sed -i 's|http://elasticsearch:9200|'$LOGSTASH_OUTPUT'|g' /usr/share/logstash/config/logstash.yml
|
||||||
|
fi
|
||||||
|
|
||||||
until curl -XGET $el_url; do
|
until curl -XGET $el_url; do
|
||||||
>&2 echo "Elastic is unavailable - sleeping."
|
>&2 echo "Elastic is unavailable - sleeping."
|
||||||
sleep 5
|
sleep 5
|
||||||
@@ -44,16 +54,6 @@ sleep 2
|
|||||||
|
|
||||||
>&2 echo "Wazuh alerts template is loaded."
|
>&2 echo "Wazuh alerts template is loaded."
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Customize logstash output ip
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
if [ "$LOGSTASH_OUTPUT" != "" ]; then
|
|
||||||
>&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
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Map environment variables to entries in logstash.yml.
|
# Map environment variables to entries in logstash.yml.
|
||||||
# Note that this will mutate logstash.yml in place if any such settings are found.
|
# Note that this will mutate logstash.yml in place if any such settings are found.
|
||||||
|
|||||||
Reference in New Issue
Block a user