Class: Fluent::SystemdInput

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

Defined Under Namespace

Classes: PosWriter

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag.



16
17
18
# File 'lib/fluent/plugin/in_systemd.rb', line 16

def tag
  @tag
end

Instance Method Details

#configure(conf) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/fluent/plugin/in_systemd.rb', line 18

def configure(conf)
  super
  @pos_writer = PosWriter.new(conf["pos_file"])
  @journal = Systemd::Journal.new(path: path)
  @read_from_head = conf["read_from_head"]
  journal.filter(*filters)
  seek
end

#shutdownObject



34
35
36
37
38
39
# File 'lib/fluent/plugin/in_systemd.rb', line 34

def shutdown
  super
  @running = false
  @thread.join
  pos_writer.shutdown
end

#startObject



27
28
29
30
31
32
# File 'lib/fluent/plugin/in_systemd.rb', line 27

def start
  super
  @running = true
  pos_writer.start
  @thread = Thread.new(&method(:run))
end