Class: Fluent::Plugin::NetflowipfixInput
- Inherits:
-
Input
- Object
- Input
- Fluent::Plugin::NetflowipfixInput
- Defined in:
- lib/fluent/plugin/in_netflowipfix.rb,
lib/fluent/plugin/parser_netflow_v5.rb,
lib/fluent/plugin/parser_netflow_v9.rb,
lib/fluent/plugin/netflowipfix_records.rb
Defined Under Namespace
Classes: Header, IP4Addr, IP6Addr, MacAddr, MplsLabel, Netflow10Packet, Netflow5Packet, Netflow9Packet, OctetArray1, OctetArray2, Option10, Option9, ParserIPfixv10, ParserNetflowBase, ParserNetflowIpfix, ParserNetflowv5, ParserNetflowv9, Template10, Template9
Instance Method Summary collapse
-
#configure(conf) ⇒ Object
config_param :protocol_type.
-
#run ⇒ Object
def shutdown.
-
#shutdown ⇒ Object
def start.
-
#start ⇒ Object
def configure.
Instance Method Details
#configure(conf) ⇒ Object
config_param :protocol_type
46 47 48 49 50 51 52 53 54 |
# File 'lib/fluent/plugin/in_netflowipfix.rb', line 46 def configure(conf) super @nbpackets = 0 @parser_v5 = ParserNetflowv5.new @parser_v9 = ParserNetflowv9.new @parser_v9.configure(@cache_ttl, @definitions) @parser_v10 = ParserIPfixv10.new @parser_v10.configure(@cache_ttl, @definitions) end |
#run ⇒ Object
def shutdown
70 71 72 73 74 75 |
# File 'lib/fluent/plugin/in_netflowipfix.rb', line 70 def run @loop.run rescue => e log.error "unexpected error", error_class: e.class, error: e. log.error_backtrace end |
#shutdown ⇒ Object
def start
63 64 65 66 67 68 |
# File 'lib/fluent/plugin/in_netflowipfix.rb', line 63 def shutdown @loop.watchers.each { |w| w.detach } @loop.stop @handler.close @thread.join end |
#start ⇒ Object
def configure
56 57 58 59 60 61 |
# File 'lib/fluent/plugin/in_netflowipfix.rb', line 56 def start @loop = Coolio::Loop.new @handler = listen(method(:receive_data)) @loop.attach(@handler) @thread = Thread.new(&method(:run)) end |