Change Elasticsearch output in Filebeat if env var was set

This commit is contained in:
manuasir
2019-06-18 18:56:41 +02:00
parent e6cddf8e1d
commit 8a6225856d
2 changed files with 15 additions and 4 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2)
set -e
# Modify the output to Elasticsearch if th ELASTICSEARCH_URL is set
if [ "$ELASTICSEARCH_URL" != "" ]; then
>&2 echo "Customize Elasticsearch ouput IP."
sed -i 's|http://elasticsearch:9200|'$ELASTICSEARCH_URL'|g' /etc/filebeat/filebeat.yml
fi