Class: Fluent::RelpInput
- Inherits:
-
Input
- Object
- Input
- Fluent::RelpInput
- Defined in:
- lib/fluent/plugin/in_relp.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #on_message(msg) ⇒ Object
- #run ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Instance Method Details
#configure(conf) ⇒ Object
17 18 19 |
# File 'lib/fluent/plugin/in_relp.rb', line 17 def configure(conf) super end |
#on_message(msg) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/fluent/plugin/in_relp.rb', line 48 def (msg) time = Engine.now record = {"message"=> msg} router.emit(@tag, time, record) rescue => e log.error msg.dump, error: e, error_class: e.class log.error_backtrace end |
#run ⇒ Object
41 42 43 44 45 46 |
# File 'lib/fluent/plugin/in_relp.rb', line 41 def run @server.run() rescue => e log.error "unexpected error", error: e, error_class: e.class log.error_backtrace end |
#shutdown ⇒ Object
35 36 37 38 39 |
# File 'lib/fluent/plugin/in_relp.rb', line 35 def shutdown super @server.server_shutdown @thread.join end |
#start ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fluent/plugin/in_relp.rb', line 21 def start super ssl_context = nil if @ssl_config != nil ssl_context = OpenSSL::SSL::SSLContext.new(:TLSv1_2) ssl_context.ca_file = @ssl_config.split(':')[2] ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER ssl_context.key = OpenSSL::PKey::RSA.new(File.open(@ssl_config.split(':')[1])) ssl_context.cert = OpenSSL::X509::Certificate.new(File.open(@ssl_config.split(':')[0])) end @server = Relp::RelpServer.new(@port, method(:on_message), @bind, ssl_context, log) @thread = Thread.new(&method(:run)) end |