Class: Fluent::OsqueryInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_osquery.rb

Defined Under Namespace

Classes: TimerWatcher

Instance Method Summary collapse

Constructor Details

#initializeOsqueryInput



14
15
16
17
# File 'lib/fluent/plugin/in_osquery.rb', line 14

def initialize
  super
  require 'json'
end

Instance Method Details

#configure(conf) ⇒ Object



19
20
21
# File 'lib/fluent/plugin/in_osquery.rb', line 19

def configure(conf)
  super
end

#runObject



36
37
38
39
40
41
# File 'lib/fluent/plugin/in_osquery.rb', line 36

def run
  @loop.run
rescue => e
  @log.error 'unexpected error', error: e.to_s
  @log.error_backtrace
end

#shutdownObject



30
31
32
33
34
# File 'lib/fluent/plugin/in_osquery.rb', line 30

def shutdown
  @tw.detach
  @loop.stop
  @thread.join
end

#startObject



23
24
25
26
27
28
# File 'lib/fluent/plugin/in_osquery.rb', line 23

def start
  @loop = Coolio::Loop.new
  @tw = TimerWatcher.new(interval, true, log, &method(:execute))
  @tw.attach(@loop)
  @thread = Thread.new(&method(:run))
end