class Fluent::Compat::TextParser::RegexpParser
def configure(conf)
def configure(conf) return if @manually_configured # not to run twice conf['expression'] ||= @stored_regexp.source conf['ignorecase'] ||= @stored_regexp.options & Regexp::IGNORECASE != 0 conf['multiline'] ||= @stored_regexp.options & Regexp::MULTILINE != 0 convert_type_converter_parameters!(conf) super end
def initialize(regexp, conf = {})
def initialize(regexp, conf = {}) super() @stored_regexp = regexp @manually_configured = false unless conf.empty? conf_init = if conf.is_a?(Fluent::Config::Element) conf else Fluent::Config::Element.new('parse', '', conf, []) end self.configure(conf_init) @manually_configured = true end end
def patterns
def patterns {'format' => @regexp, 'time_format' => @time_format} end