Skip to content

Commit

Permalink
Merge pull request #5 from edevil/idle_timeout
Browse files Browse the repository at this point in the history
Allow the idle_timeout parameter to be configured.
  • Loading branch information
roiravhon authored Aug 7, 2016
2 parents 407f601 + 9d349f2 commit 1079a1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
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

0 comments on commit 1079a1b

Please sign in to comment.