Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the idle_timeout parameter to be configured. #5

Merged
merged 1 commit into from
Aug 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ If you absolutly must, use the non-buffered plugin (we really recommend using th
* **endpoint_url** the url to Logz.io input where `xxx-xxxx...` is your Logz.io access token, and `my_type` is the type of your logs in logz.io
* **output_include_time** should the appender add a timestamp to your logs on their process time. (recommended)
* **output_include_tags** should the appender add the fluentd tag to the document, called "fluentd_tag"
* **http_idle_timeout** timeout in seconds that the http persistent connection will stay open without traffic
3 changes: 3 additions & 0 deletions lib/fluent/plugin/out_logzio_buffered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class LogzioOutputBuffered < Fluent::BufferedOutput
config_param :output_include_time, :bool, default: true
config_param :output_include_tags, :bool, default: true
config_param :retry_count, :integer, default: 3 # How many times to resend failed bulks. Undocumented because not suppose to be changed
config_param :http_idle_timeout, :integer, default: 5

unless method_defined?(:log)
define_method('log') { $log }
Expand All @@ -21,6 +22,8 @@ def start
@uri = URI @endpoint_url
@http = Net::HTTP::Persistent.new 'fluent-plugin-logzio', :ENV
@http.headers['Content-Type'] = 'text/plain'
@http.idle_timeout = @http_idle_timeout
@http.socket_options << [Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, 1]
$log.debug "Started logzio shipper.."
end

Expand Down