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

Returns a new instance of OsqueryInput.



9
10
11
12
# File 'lib/fluent/plugin/in_osquery.rb', line 9

def initialize
  super
  require 'json'
end

Instance Method Details

#configure(conf) ⇒ Object



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

def configure(conf)
  super
end

#runObject



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

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

#shutdownObject



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

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

#startObject



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

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