Class: LogStash::Inputs::Varnishlog

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

Overview

Read from varnish cache’s shared memory log

Instance Method Summary collapse

Instance Method Details

#closeObject



45
46
47
# File 'lib/logstash/inputs/varnishlog.rb', line 45

def close
  finished
end

#registerObject



12
13
14
15
16
17
18
# File 'lib/logstash/inputs/varnishlog.rb', line 12

def register
  require 'varnish'
  @vd = Varnish::VSM.VSM_New
  Varnish::VSL.VSL_Setup(@vd)
  Varnish::VSL.VSL_Open(@vd, 1)

end

#run(queue) ⇒ Object

def register



20
21
22
23
24
# File 'lib/logstash/inputs/varnishlog.rb', line 20

def run(queue)
  @q = queue
  @hostname = Socket.gethostname
  Varnish::VSL.VSL_Dispatch(@vd, self.method(:cb).to_proc, FFI::MemoryPointer.new(:pointer))
end