Class: LogStash::Inputs::Varnishlog
- Inherits:
-
Threadable
- Object
- Threadable
- LogStash::Inputs::Varnishlog
- Defined in:
- lib/logstash/inputs/varnishlog.rb
Overview
Read from varnish cache’s shared memory log
Instance Method Summary collapse
- #close ⇒ Object
- #register ⇒ Object
-
#run(queue) ⇒ Object
def register.
Instance Method Details
#close ⇒ Object
45 46 47 |
# File 'lib/logstash/inputs/varnishlog.rb', line 45 def close finished end |
#register ⇒ Object
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 |