Class: Fluent::RtailOutput
- Inherits:
-
BufferedOutput
- Object
- BufferedOutput
- Fluent::RtailOutput
- Includes:
- SetTagKeyMixin, SetTimeKeyMixin
- Defined in:
- lib/fluent/plugin/out_rtail.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #format(tag, time, record) ⇒ Object
-
#initialize ⇒ RtailOutput
constructor
A new instance of RtailOutput.
- #write(chunk) ⇒ Object
Constructor Details
#initialize ⇒ RtailOutput
18 19 20 21 22 |
# File 'lib/fluent/plugin/out_rtail.rb', line 18 def initialize super require 'multi_json' require 'socket' end |
Instance Method Details
#configure(conf) ⇒ Object
24 25 26 27 28 |
# File 'lib/fluent/plugin/out_rtail.rb', line 24 def configure(conf) super @socket = UDPSocket.new @socket.connect(@host, @port) end |
#format(tag, time, record) ⇒ Object
30 31 32 |
# File 'lib/fluent/plugin/out_rtail.rb', line 30 def format(tag, time, record) [tag, time, record].to_msgpack end |
#write(chunk) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fluent/plugin/out_rtail.rb', line 34 def write(chunk) chunk = chunk.to_enum(:msgpack_each) chunk.each do |tag, time, record| log_stream_id = get_log_stream_id(tag, time, record) next unless log_stream_id content = get_content(tag, time, record) next unless content (log_stream_id, time, content) end rescue => e log.error e. log.error_backtrace e.backtrace end |