Class: Fluent::Plugin::OutSyslogRFC5424
- Inherits:
-
Output
- Object
- Output
- Fluent::Plugin::OutSyslogRFC5424
- Defined in:
- lib/fluent/plugin/out_syslog_rfc5424.rb
Constant Summary collapse
- DEFAULT_FORMATTER =
"syslog_rfc5424"
Instance Method Summary collapse
Instance Method Details
#close ⇒ Object
39 40 41 42 43 |
# File 'lib/fluent/plugin/out_syslog_rfc5424.rb', line 39 def close super @sockets.each_value { |s| s.close } @sockets = {} end |
#configure(config) ⇒ Object
20 21 22 23 24 |
# File 'lib/fluent/plugin/out_syslog_rfc5424.rb', line 20 def configure(config) super @sockets = {} @formatter = formatter_create end |
#write(chunk) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/fluent/plugin/out_syslog_rfc5424.rb', line 26 def write(chunk) socket = find_or_create_socket(@transport.to_sym, @host, @port) tag = chunk..tag chunk.each do |time, record| begin socket.puts @formatter.format(tag, time, record) rescue @sockets[socket_key(@transport.to_sym, @host, @port)] = nil raise end end end |