Skip to content

Commit 6dfe1f1

Browse files
committed
Add keepalive option
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
1 parent fe59adc commit 6dfe1f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/fluent/plugin/out_forward.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ class ConnectionClosedError < Error; end
103103
config_param :tls_client_private_key_path, :string, default: nil
104104
desc 'The client private key passphrase for TLS.'
105105
config_param :tls_client_private_key_passphrase, :string, default: nil, secret: true
106+
desc "Enable keepalive connection."
107+
config_param :keepalive, :bool, default: false
108+
desc "Expired time of keepalive. Default value is nil, which means to keep connection as long as possible"
109+
config_param :keepalive_timeout, :time, default: nil
106110

107111
config_section :security, required: false, multi: false do
108112
desc 'The hostname'
@@ -227,6 +231,10 @@ def configure(conf)
227231
raise Fluent::ConfigError, "forward output plugin requires at least one <server> is required"
228232
end
229233

234+
unless @keepalive
235+
log.warn "The value of keepalive_timeout is ignored. if you want to use keepalive, please add to your conf `keepalive: true`."
236+
end
237+
230238
raise Fluent::ConfigError, "ack_response_timeout must be a positive integer" if @ack_response_timeout < 1
231239
end
232240

0 commit comments

Comments
 (0)