Class: LogStash::Inputs::FileListener
- Inherits:
-
Object
- Object
- LogStash::Inputs::FileListener
- Defined in:
- lib/logstash/inputs/file_listener.rb
Overview
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.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #accept(data) ⇒ Object
- #deleted ⇒ Object
- #eof ⇒ Object
- #error ⇒ Object
-
#initialize(path, input, data = nil) ⇒ FileListener
constructor
construct with link back to the input plugin instance.
- #opened ⇒ Object
- #process_event(event) ⇒ Object
- #reading_completed ⇒ Object
- #timed_out ⇒ Object
Constructor Details
permalink #initialize(path, input, data = nil) ⇒ FileListener
construct with link back to the input plugin instance.
10 11 12 13 |
# File 'lib/logstash/inputs/file_listener.rb', line 10 def initialize(path, input, data = nil) @path, @input = path, input @data = data end |
Instance Attribute Details
permalink #data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/logstash/inputs/file_listener.rb', line 8 def data @data end |
permalink #input ⇒ Object (readonly)
Returns the value of attribute input.
8 9 10 |
# File 'lib/logstash/inputs/file_listener.rb', line 8 def input @input end |
permalink #path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/logstash/inputs/file_listener.rb', line 8 def path @path end |
Instance Method Details
permalink #accept(data) ⇒ Object
[View source]
36 37 38 39 40 |
# 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 |
permalink #deleted ⇒ Object
[View source]
31 32 33 34 |
# File 'lib/logstash/inputs/file_listener.rb', line 31 def deleted input.codec.evict(path) input.handle_deletable_path(path) end |
permalink #eof ⇒ Object
[View source]
18 19 |
# File 'lib/logstash/inputs/file_listener.rb', line 18 def eof end |
permalink #error ⇒ Object
[View source]
21 22 |
# File 'lib/logstash/inputs/file_listener.rb', line 21 def error end |
permalink #opened ⇒ Object
[View source]
15 16 |
# File 'lib/logstash/inputs/file_listener.rb', line 15 def opened end |
permalink #process_event(event) ⇒ Object
[View source]
42 43 44 |
# File 'lib/logstash/inputs/file_listener.rb', line 42 def process_event(event) input.post_process_this(event, path) end |
permalink #reading_completed ⇒ Object
[View source]
24 25 |
# File 'lib/logstash/inputs/file_listener.rb', line 24 def reading_completed end |
permalink #timed_out ⇒ Object
[View source]
27 28 29 |
# File 'lib/logstash/inputs/file_listener.rb', line 27 def timed_out input.codec.evict(path) end |