class Fluent::Plugin::NetflowipfixInput::ParserNetflowBase
Private Instance Methods
format_for_flowMicroSeconds(time)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v5.rb, line 56 def format_for_flowMicroSeconds(time) time.utc.strftime("%Y-%m-%dT%H:%M:%S.%6NZ".freeze) end
format_for_flowMilliSeconds(time)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v5.rb, line 52 def format_for_flowMilliSeconds(time) time.utc.strftime("%Y-%m-%dT%H:%M:%S.%3NZ".freeze) end
format_for_flowNanoSeconds(time)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v5.rb, line 60 def format_for_flowNanoSeconds(time) time.utc.strftime("%Y-%m-%dT%H:%M:%S.%9NZ".freeze) end
format_for_flowSeconds(time)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v5.rb, line 48 def format_for_flowSeconds(time) time.utc.strftime("%Y-%m-%dT%H:%M:%S".freeze) end
format_for_switched(time)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v5.rb, line 44 def format_for_switched(time) time.utc.strftime("%Y-%m-%dT%H:%M:%S.%3NZ".freeze) end
ipv4_addr_to_string(uint32)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v5.rb, line 29 def ipv4_addr_to_string(uint32) "#{(uint32 & 0xff000000) >> 24}.#{(uint32 & 0x00ff0000) >> 16}.#{(uint32 & 0x0000ff00) >> 8}.#{uint32 & 0x000000ff}" end
msec_from_boot_to_time(msec, uptime, current_unix_time, current_nsec)
click to toggle source
# File lib/fluent/plugin/parser_netflow_v5.rb, line 33 def msec_from_boot_to_time(msec, uptime, current_unix_time, current_nsec) millis = uptime - msec seconds = current_unix_time - (millis / 1000) micros = (current_nsec / 1000) - ((millis % 1000) * 1000) if micros < 0 seconds -= 1 micros += 1000000 end Time.at(seconds, micros) end