Class: LogStash::Inputs::Varnishlog
- Inherits:
-
Threadable
- Object
- Plugin
- Base
- Threadable
- LogStash::Inputs::Varnishlog
- Defined in:
- lib/logstash/inputs/varnishlog.rb
Overview
Read from varnish cache’s shared memory log
Constant Summary
Constants included from Config::Mixin
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Config::Mixin
Attributes inherited from Plugin
Instance Method Summary collapse
- #register ⇒ Object
-
#run(queue) ⇒ Object
def register.
- #teardown ⇒ Object
Methods inherited from Threadable
Methods inherited from Base
Methods included from Config::Mixin
Methods inherited from Plugin
#eql?, #finished, #finished?, #hash, #initialize, #inspect, lookup, #reload, #running?, #shutdown, #terminating?, #to_s
Constructor Details
This class inherits a constructor from LogStash::Inputs::Threadable
Instance Method Details
#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 |
#teardown ⇒ Object
45 46 47 |
# File 'lib/logstash/inputs/varnishlog.rb', line 45 def teardown finished end |