require 'fluent/parser' module Fluent class TextParser class NewSyslogParser < Parser # register as newsyslog parser Plugin.register_parser('newsyslog', self) # default to using the built in ruby time parser rather than specifying a time format config_param :time_format, :string, :default => nil #"%b %d %H:%M:%S" config_param :payload_message, :bool, :default => false config_param :with_priority, :bool, :default => false def initialize super @mutex = Mutex.new end def configure(conf) super @time_parser = TimeParser.new(@time_format) end def parse(text) if @with_priority if /^\<.*\>\d/.match(text) #match rfc5424 syslog format regex = /^\<(?[0-9]+)\>(1)(?