Class: LogStash::Inputs::File::ListenerTail
- Inherits:
-
Object
- Object
- LogStash::Inputs::File::ListenerTail
- Defined in:
- lib/logstash/inputs/file.rb
Overview
def register
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#data ⇒ Object
readonly
use attr_reader to define noop methods.
-
#deleted ⇒ Object
readonly
Returns the value of attribute deleted.
-
#eof ⇒ Object
readonly
Returns the value of attribute eof.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#input ⇒ Object
readonly
use attr_reader to define noop methods.
-
#path ⇒ Object
readonly
use attr_reader to define noop methods.
Instance Method Summary collapse
- #accept(data) ⇒ Object
- #add_state(data) ⇒ Object
-
#initialize(path, input) ⇒ ListenerTail
constructor
construct with upstream state.
- #process_event(event) ⇒ Object
- #timed_out ⇒ Object
Constructor Details
#initialize(path, input) ⇒ ListenerTail
construct with upstream state
221 222 223 |
# File 'lib/logstash/inputs/file.rb', line 221 def initialize(path, input) @path, @input = path, input end |
Instance Attribute Details
#created ⇒ Object (readonly)
Returns the value of attribute created.
218 219 220 |
# File 'lib/logstash/inputs/file.rb', line 218 def created @created end |
#data ⇒ Object (readonly)
use attr_reader to define noop methods
217 218 219 |
# File 'lib/logstash/inputs/file.rb', line 217 def data @data end |
#deleted ⇒ Object (readonly)
Returns the value of attribute deleted.
218 219 220 |
# File 'lib/logstash/inputs/file.rb', line 218 def deleted @deleted end |
#eof ⇒ Object (readonly)
Returns the value of attribute eof.
218 219 220 |
# File 'lib/logstash/inputs/file.rb', line 218 def eof @eof end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
218 219 220 |
# File 'lib/logstash/inputs/file.rb', line 218 def error @error end |
#input ⇒ Object (readonly)
use attr_reader to define noop methods
217 218 219 |
# File 'lib/logstash/inputs/file.rb', line 217 def input @input end |
#path ⇒ Object (readonly)
use attr_reader to define noop methods
217 218 219 |
# File 'lib/logstash/inputs/file.rb', line 217 def path @path end |
Instance Method Details
#accept(data) ⇒ Object
229 230 231 232 233 |
# File 'lib/logstash/inputs/file.rb', line 229 def accept(data) # and push transient data filled dup listener downstream input.log_line_received(path, data) input.codec.accept(dup_adding_state(data)) end |
#add_state(data) ⇒ Object
241 242 243 244 |
# File 'lib/logstash/inputs/file.rb', line 241 def add_state(data) @data = data self end |
#process_event(event) ⇒ Object
235 236 237 238 239 |
# File 'lib/logstash/inputs/file.rb', line 235 def process_event(event) event["[@metadata][path]"] = path event["path"] = path if !event.include?("path") input.post_process_this(event) end |
#timed_out ⇒ Object
225 226 227 |
# File 'lib/logstash/inputs/file.rb', line 225 def timed_out input.codec.evict(path) end |