Class: Fluent::OsqueryInput
- Inherits:
-
Input
- Object
- Input
- Fluent::OsqueryInput
- Defined in:
- lib/fluent/plugin/in_osquery.rb
Defined Under Namespace
Classes: TimerWatcher
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ OsqueryInput
constructor
A new instance of OsqueryInput.
- #run ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ OsqueryInput
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 |
#run ⇒ Object
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 |
#shutdown ⇒ Object
25 26 27 28 29 |
# File 'lib/fluent/plugin/in_osquery.rb', line 25 def shutdown @tw.detach @loop.stop @thread.join end |
#start ⇒ Object
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 |