2023-12-11 19:02:42 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# If the user has supplied only arguments append them to `fluentd` command
|
|
|
|
if [ "${1#-}" != "$1" ]; then
|
|
|
|
set -- fluentd "$@"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If user does not supply config file or plugins, use the default
|
|
|
|
if [ "$1" = "fluentd" ]; then
|
|
|
|
if ! echo $@ | grep -e ' \-c' -e ' \-\-config' ; then
|
|
|
|
set -- "$@" --config /fluentd/etc/${FLUENTD_CONF}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! echo $@ | grep -e ' \-p' -e ' \-\-plugin' ; then
|
|
|
|
set -- "$@" --plugin /fluentd/plugins
|
|
|
|
fi
|
|
|
|
|
|
|
|
SIMPLE_SNIFFER=$( gem contents fluent-plugin-elasticsearch | grep elasticsearch_simple_sniffer.rb )
|
|
|
|
if [ -n "$SIMPLE_SNIFFER" -a -f "$SIMPLE_SNIFFER" ] ; then
|
|
|
|
set -- "$@" -r $SIMPLE_SNIFFER
|
|
|
|
fi
|
2023-12-13 17:54:52 +00:00
|
|
|
|
|
|
|
set -- "$@" --gemfile /fluentd/Gemfile
|
2023-12-11 19:02:42 +00:00
|
|
|
fi
|
|
|
|
|
2023-12-13 17:54:52 +00:00
|
|
|
exec "$@" ${FLUENTD_OPT}
|