Skip to content

Commit 09c6601

Browse files
kenhysslopezz
andauthored
Backport(v1.16) Add OpenSearch sniffer class name and use it by default (#1544) (#1561)
Signed-off-by: Sergio López <[email protected]> Signed-off-by: Kentaro Hayashi <[email protected]> Co-authored-by: Sergio López <[email protected]>
1 parent d6ff982 commit 09c6601

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

templates/conf/fluent.conf.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
logstash_format "#{ENV['FLUENT_OPENSEARCH_LOGSTASH_FORMAT'] || 'false'}"
8383
logstash_prefix "#{ENV['FLUENT_OPENSEARCH_LOGSTASH_PREFIX'] || 'logstash'}"
8484
logstash_prefix_separator "#{ENV['FLUENT_OPENSEARCH_LOGSTASH_PREFIX_SEPARATOR'] || '-'}"
85+
sniffer_class_name "#{ENV['FLUENT_OPENSEARCH_SNIFFER_CLASS_NAME'] || 'Fluent::Plugin::OpenSearchSimpleSniffer'}"
8586
<buffer>
8687
flush_thread_count "#{ENV['FLUENT_OPENSEARCH_BUFFER_FLUSH_THREAD_COUNT'] || '1'}"
8788
flush_mode "#{ENV['FLUENT_OPENSEARCH_BUFFER_FLUSH_MODE'] || 'interval'}"

templates/entrypoint.sh.erb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ if [ -n "$SIMPLE_SNIFFER" -a -f "$SIMPLE_SNIFFER" ] ; then
1414
FLUENTD_OPT="$FLUENTD_OPT -r $SIMPLE_SNIFFER"
1515
fi
1616

17+
<% end %>
18+
<% if target == "opensearch" %>
19+
20+
set -e
21+
22+
SIMPLE_SNIFFER=$( gem contents fluent-plugin-opensearch | grep opensearch_simple_sniffer.rb )
23+
24+
if [ -n "$SIMPLE_SNIFFER" -a -f "$SIMPLE_SNIFFER" ] ; then
25+
FLUENTD_OPT="$FLUENTD_OPT -r $SIMPLE_SNIFFER"
26+
fi
27+
1728
<% end %>
1829

1930
exec fluentd -c /fluentd/etc/${FLUENTD_CONF} -p /fluentd/plugins --gemfile /fluentd/Gemfile ${FLUENTD_OPT}

0 commit comments

Comments
 (0)