lib/fluent/plugin/in_tail.rb in fluentd-1.6.3 vs lib/fluent/plugin/in_tail.rb in fluentd-1.7.0.rc1
- old
+ new
@@ -95,10 +95,14 @@
desc 'Enable the option to skip the refresh of watching list on startup.'
config_param :skip_refresh_on_startup, :bool, default: false
desc 'Ignore repeated permission error logs'
config_param :ignore_repeated_permission_error, :bool, default: false
+ config_section :parse, required: false, multi: true, init: true, param_name: :parser_configs do
+ config_argument :usage, :string, default: 'in_tail_parser'
+ end
+
attr_reader :paths
@@pos_file_paths = {}
def configure(conf)
@@ -146,11 +150,12 @@
method(:parse_multilines)
else
method(:parse_singleline)
end
@file_perm = system_config.file_permission || FILE_PERMISSION
- @parser = parser_create(conf: parser_config)
+ # parser is already created by parser helper
+ @parser = parser_create(usage: parser_config['usage'] || @parser_configs.first.usage)
end
def configure_tag
if @tag.index('*')
@tag_prefix, @tag_suffix = @tag.split('*')
@@ -429,10 +434,10 @@
end
log.warn "pattern not matched: #{line.inspect}"
end
}
rescue => e
- log.warn line.dump, error: e.to_s
+ log.warn 'invalid line found', file: tail_watcher.path, line: line, error: e.to_s
log.debug_backtrace(e.backtrace)
end
end
def parse_singleline(lines, tail_watcher)