diff --git a/lib/fluent/plugin/out_forward.rb b/lib/fluent/plugin/out_forward.rb index 8144ba3565..744faba32f 100644 --- a/lib/fluent/plugin/out_forward.rb +++ b/lib/fluent/plugin/out_forward.rb @@ -136,6 +136,12 @@ def configure(conf) log.info "adding forwarding server '#{name}'", host: host, port: port, weight: weight, plugin_id: plugin_id } + if @compress == :gzip && @buffer.compress == :text + @buffer.compress = :gzip + elsif @compress == :text && @buffer.compress == :gzip + log.info "buffer is compressed. If you also want to save the bandwidth of a network, Add `compress` configuration in " + end + if @nodes.empty? raise ConfigError, "forward output plugin requires at least one is required" end diff --git a/test/plugin/test_out_forward.rb b/test/plugin/test_out_forward.rb index 83f2732a90..f94969ec49 100644 --- a/test/plugin/test_out_forward.rb +++ b/test/plugin/test_out_forward.rb @@ -110,7 +110,7 @@ def test_configure_gzip_compress_in_buffer compress gzip ]) - assert_equal :gzip, d.instance.compress + assert_equal :text, d.instance.compress assert_equal :gzip, d.instance.buffer.compress end