class Fluent::Plugin::NetflowipfixInput::ParserIPfixv10
Public Instance Methods
configure(cache_ttl, definitions)
click to toggle source
Calls superclass method
Fluent::Plugin::NetflowipfixInput::ParserNetflowIpfix#configure
# File lib/fluent/plugin/parser_netflow_v9.rb, line 307 def configure(cache_ttl, definitions) super(cache_ttl, definitions) @templates10 = Vash.new() @samplers_v10 = Vash.new() # Path to default Netflow v10 field definitions filename10 = File.expand_path('../ipfix_fields.yaml', __FILE__) begin @fields10 = YAML.load_file(filename10) rescue => e raise ConfigError, "Bad syntax in definitions file #{filename10}, error_class = #{e.class.name}, error = #{e.message}" end # Allow the user to augment/override/rename the supported Netflow fields if @definitions raise ConfigError, "definitions file #{@definitions} doesn't exist" unless File.exist?(@definitions) begin @fields10['option'].merge!(YAML.load_file(@definitions)) rescue => e raise ConfigError, "Bad syntax in definitions file #{@definitions}, error_class = #{e.class.name}, error = #{e.message}" end end end
handle_v10(host, pdu, block)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v9.rb, line 332 def handle_v10(host, pdu, block) pdu.records.each do |flowset| case flowset.flowset_id when 2 handle_flowset_template(host, pdu, flowset, @templates10, @fields10) when 3 handle_flowset_options_template(host, pdu, flowset, @templates10, @fields10) when 256..65535 handle_flowset_data(host, pdu, flowset, block, @templates10, @fields10, 10) else $log.warn 'v10 Unsupported set', set_id: flowset.set_id end # case end # do end