class LogStash::Inputs::FileProgress::ListenerTail
Attributes
created[R]
data[R]
use attr_reader to define noop methods
deleted[R]
eof[R]
error[R]
input[R]
use attr_reader to define noop methods
path[R]
use attr_reader to define noop methods
pos[R]
use attr_reader to define noop methods
size[R]
use attr_reader to define noop methods
Public Class Methods
new(path, input)
click to toggle source
construct with upstream state
# File lib/logstash/inputs/file_progress.rb, line 252 def initialize(path, input) @path, @input = path, input end
Public Instance Methods
accept(data, size, pos)
click to toggle source
# File lib/logstash/inputs/file_progress.rb, line 260 def accept(data, size, pos) # and push transient data filled dup listener downstream input.log_line_received(path, data) input.codec.accept(dup_adding_state(data, size, pos)) end
add_state(data, size, pos)
click to toggle source
# File lib/logstash/inputs/file_progress.rb, line 274 def add_state(data, size, pos) @data = data @size = size @pos = pos self end
process_event(event)
click to toggle source
# File lib/logstash/inputs/file_progress.rb, line 266 def process_event(event) event.set("[@metadata][size]", size) unless size.nil? event.set("[@metadata][pos]", pos) unless pos.nil? event.set("[@metadata][path]", path) event.set("path", path) if !event.include?("path") input.post_process_this(event) end
timed_out()
click to toggle source
# File lib/logstash/inputs/file_progress.rb, line 256 def timed_out input.codec.evict(path) end
Private Instance Methods
dup_adding_state(line, size, pos)
click to toggle source
duplicate and add state for downstream
# File lib/logstash/inputs/file_progress.rb, line 284 def dup_adding_state(line, size, pos) self.class.new(path, input).add_state(line, size, pos) end