Class: LogStash::Outputs::Rethinkdb

Inherits:
Base
  • Object
show all
Includes:
RethinkDB::Shortcuts
Defined in:
lib/logstash/outputs/rethinkdb.rb

Instance Method Summary collapse

Instance Method Details

#closeObject



53
54
55
# File 'lib/logstash/outputs/rethinkdb.rb', line 53

def close
  connection.close
end

#receive(event) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/logstash/outputs/rethinkdb.rb', line 57

def receive(event)
  @codec.encode(event)
rescue LocalJumpError
  # This LocalJumpError rescue clause is required to test for regressions
  # for https://github.com/logstash-plugins/logstash-output-redis/issues/26
  # see specs. Without it the LocalJumpError is rescued by the StandardError
  raise
rescue StandardError => e
  @logger.warn('Error encoding event', exception: e,
                                       event: event)
end

#registerObject

# If batch is set to true, the maximum amount of time between RPUSH commands # when there are pending events to flush. config :batch_timeout, :validate => :number, :default => 5



48
49
50
51
# File 'lib/logstash/outputs/rethinkdb.rb', line 48

def register
  @codec.on_event(&method(:send_to_rethink))
  create_table
end