Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit ed5f0a5

Browse files
author
Chris Wiechmann
committed
[skip ci] Deprecation warning and error handling
1 parent 1e4d5f9 commit ed5f0a5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

filebeat/scripts/custom-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
# This script adjusts the configured list of Logstash hosts
44
# as is it required by Filebeat.
55

6+
if [ -z "${LOGSTASH_HOSTS}" ];then
7+
if [ -z "${LOGSTASH}" ]; then
8+
echo "Parameter: LOGSTASH_HOSTS is missing";
9+
exit 99;
10+
else
11+
echo "Parameter LOGSTASH is deprecated. Please migrate your configuration to parameter: LOGSTASH_HOSTS";
12+
LOGSTASH_HOSTS=${LOGSTASH}
13+
fi
14+
fi
15+
616
hostsForFilebeat=`echo ${LOGSTASH_HOSTS} | awk '{split($0, va, /,/); vl=""; for (v in va) { if (vl =="" ) vl = sprintf("\"%s\"", va[v]); else vl = vl sprintf(",\"%s\"", va[v]); } printf("'[%s]'", vl) }'`
717

818
echo "Adjusted given Logstash hosts: ${hostsForFilebeat} for Filebeat"
919

1020
export LOGSTASH_HOSTS=$hostsForFilebeat
1121

1222
# Finally call the original Docker-Entrypoint
13-
/usr/local/bin/docker-entrypoint "$@"
23+
/usr/local/bin/docker-entrypoint "$@"

0 commit comments

Comments
 (0)