Class: Fluent::NetflowInput
- Inherits:
-
Input
- Object
- Input
- Fluent::NetflowInput
- Defined in:
- lib/fluent/plugin/in_netflow.rb
Defined Under Namespace
Classes: UdpHandler
Instance Method Summary collapse
Instance Method Details
#configure(conf) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/fluent/plugin/in_netflow.rb', line 38 def configure(conf) super @parser = TextParser::NetflowParser.new @parser.configure(conf) end |
#run ⇒ Object
62 63 64 65 66 67 |
# File 'lib/fluent/plugin/in_netflow.rb', line 62 def run @loop.run rescue => e log.error "unexpected error", error_class: e.class, error: e. log.error_backtrace end |
#shutdown ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/fluent/plugin/in_netflow.rb', line 54 def shutdown @loop.watchers.each { |w| w.detach } @loop.stop @handler.close @thread.join super end |
#start ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/fluent/plugin/in_netflow.rb', line 45 def start super @loop = Coolio::Loop.new @handler = listen(method(:receive_data)) @loop.attach(@handler) @thread = Thread.new(&method(:run)) end |