Class: Fluent::Plugin::SystemdInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_systemd.rb

Overview

Fluentd plugin for reading from the systemd journal

Constant Summary collapse

DEFAULT_STORAGE_TYPE =
'local'

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/fluent/plugin/in_systemd.rb', line 50

def configure(conf)
  super
  @journal = nil
  @pos_storage = storage_create(usage: 'positions')
  @mutator = SystemdEntryMutator.new(**@entry_opts.to_h)
  @mutator.warnings.each { |warning| log.warn(warning) }
end

#shutdownObject



64
65
66
67
68
69
70
71
# File 'lib/fluent/plugin/in_systemd.rb', line 64

def shutdown
  @running = false
  @journal&.close
  @journal = nil
  @pos_storage = nil
  @mutator = nil
  super
end

#startObject



58
59
60
61
62
# File 'lib/fluent/plugin/in_systemd.rb', line 58

def start
  super
  @running = true
  timer_execute(:in_systemd_emit_worker, 1, &method(:run))
end