Class: LogStash::Outputs::Progress

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/outputs/progress.rb

Overview

File output.

Write since_db-file with progress

Instance Method Summary collapse

Instance Method Details

#receive(event) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/logstash/outputs/progress.rb', line 39

def receive(event)
  return unless output?(event)

  if @message_format
    output = event.sprintf(@message_format)
  else
    output = event.to_json
  end

  ino, dev_major, dev_minor, size, pos = event["message"].split(" ", 5)

  inode = [ino.to_i, dev_major.to_i, dev_minor.to_i, size.to_i]

  if event.include? "tags" and event["tags"].include?("del")
    @sincedb.delete(inode)
  else
    @sincedb[inode] = output
  end
  _sincedb_write(event["path"])

end

#registerObject



31
32
33
34
35
36
# File 'lib/logstash/outputs/progress.rb', line 31

def register
  require "fileutils" # For mkdir_p

  workers_not_supported
  @sincedb = {}
end