Class: Fluent::HatoholOutput
- Inherits:
-
BufferedOutput
- Object
- BufferedOutput
- Fluent::HatoholOutput
- Defined in:
- lib/fluent/plugin/out_hatohol.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #format(tag, time, record) ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
- #write(chunk) ⇒ Object
Instance Method Details
#configure(conf) ⇒ Object
33 34 35 36 |
# File 'lib/fluent/plugin/out_hatohol.rb', line 33 def configure(conf) super validate_configuraiton end |
#format(tag, time, record) ⇒ Object
56 57 58 |
# File 'lib/fluent/plugin/out_hatohol.rb', line 56 def format(tag, time, record) [tag, time, record].to_msgpack end |
#shutdown ⇒ Object
51 52 53 54 |
# File 'lib/fluent/plugin/out_hatohol.rb', line 51 def shutdown super @connection.close end |
#start ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fluent/plugin/out_hatohol.rb', line 38 def start super = { :tls_cert => @tls_cert, :tls_key => @tls_key, :tls_ca_certificates => @tls_ca_certificates, } @connection = Bunny.new(url || {}, ) @connection.start @channel = @connection.create_channel @queue = @channel.queue(@queue_name) end |
#write(chunk) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/fluent/plugin/out_hatohol.rb', line 60 def write(chunk) chunk.msgpack_each do |tag, time, record| @queue.publish(JSON.generate((tag, time, record)), :content_type => "application/json") end end |