Class: LogStash::Inputs::File::ListenerTail

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/inputs/file.rb

Overview

def register

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#createdObject (readonly)

Returns the value of attribute created.



218
219
220
# File 'lib/logstash/inputs/file.rb', line 218

def created
  @created
end

#dataObject (readonly)

use attr_reader to define noop methods



217
218
219
# File 'lib/logstash/inputs/file.rb', line 217

def data
  @data
end

#deletedObject (readonly)

Returns the value of attribute deleted.



218
219
220
# File 'lib/logstash/inputs/file.rb', line 218

def deleted
  @deleted
end

#eofObject (readonly)

Returns the value of attribute eof.



218
219
220
# File 'lib/logstash/inputs/file.rb', line 218

def eof
  @eof
end

#errorObject (readonly)

Returns the value of attribute error.



218
219
220
# File 'lib/logstash/inputs/file.rb', line 218

def error
  @error
end

#inputObject (readonly)

use attr_reader to define noop methods



217
218
219
# File 'lib/logstash/inputs/file.rb', line 217

def input
  @input
end

#pathObject (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_outObject



225
226
227
# File 'lib/logstash/inputs/file.rb', line 225

def timed_out
  input.codec.evict(path)
end