lib/fluent/plugin/in_systemd.rb in fluent-plugin-systemd-1.0.0.rc1 vs lib/fluent/plugin/in_systemd.rb in fluent-plugin-systemd-1.0.0.rc2

- old
+ new

@@ -13,11 +13,12 @@ helpers :timer, :storage DEFAULT_STORAGE_TYPE = 'local' config_param :path, :string, default: '/var/log/journal' - config_param :filters, :array, default: [] + config_param :filters, :array, default: [], deprecated: 'filters has been renamed as matches' + config_param :matches, :array, default: nil config_param :read_from_head, :bool, default: false config_param :tag, :string config_section :storage do config_set_default :usage, 'positions' @@ -52,10 +53,10 @@ @journal.close if @journal # rubocop:disable Style/SafeNavigation @journal = Systemd::Journal.new(path: @path) # make sure initial call to wait doesn't return :invalidate # see https://github.com/ledbettj/systemd-journal/issues/70 @journal.wait(0) - @journal.filter(*@filters) + @journal.filter(*(@matches || @filters)) seek true rescue Systemd::JournalError => e log.warn("#{e.class}: #{e.message} retrying in 1s") false