class Fluent::TextParser::Fw1LoggrabberParser
Public Class Methods
new()
click to toggle source
This method is called after config_params have read configuration parameter
Calls superclass method
# File lib/fluent/plugin/parser_fw1_loggrabber.rb, line 11 def initialize super @pattern_key_value = /(?<=^|[^\\]\|)([^=\s]+)=((?:[^|]|(?:(?<=\\)\|))+)/ end
Public Instance Methods
configure(conf={})
click to toggle source
Calls superclass method
# File lib/fluent/plugin/parser_fw1_loggrabber.rb, line 16 def configure(conf={}) super end
logparse(text)
click to toggle source
# File lib/fluent/plugin/parser_fw1_loggrabber.rb, line 26 def logparse(text) return {} if (nil == text) record = Hash.new begin for pair in text.scan(@pattern_key_value) do record[pair[0]] = pair[1] end rescue => e log.error e.message return {} end return record end
parse(text) { |now, record| ... }
click to toggle source
# File lib/fluent/plugin/parser_fw1_loggrabber.rb, line 20 def parse(text) record = logparse(text) yield Engine.now, record end