class LogStash::Inputs::FileListener
As and when a new WatchedFile is processed FileWatch
asks for an instance of this class for the file path of that WatchedFile. All subsequent callbacks are sent via this listener instance. The file is essentially a stream and the path is the identity of that stream.
Attributes
data[R]
input[R]
path[R]
Public Class Methods
new(path, input, data = nil)
click to toggle source
construct with link back to the input plugin instance.
# File lib/logstash/inputs/file_listener.rb, line 10 def initialize(path, input, data = nil) @path, @input = path, input @data = data end
Public Instance Methods
accept(data)
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 36 def accept(data) # and push transient data filled dup listener downstream input.log_line_received(path, data) input.codec.accept(self.class.new(path, input, data)) end
deleted()
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 31 def deleted input.codec.evict(path) input.handle_deletable_path(path) end
eof()
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 18 def eof end
error()
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 21 def error end
opened()
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 15 def opened end
process_event(event)
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 42 def process_event(event) input.post_process_this(event, path) end
reading_completed()
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 24 def reading_completed end
timed_out()
click to toggle source
# File lib/logstash/inputs/file_listener.rb, line 27 def timed_out input.codec.evict(path) end