Sha256: b3439433e80f069b193db78bfe44fac3adbd3adb4e059f439a1d746aaf83941d

Contents?: true

Size: 488 Bytes

Versions: 16

Compression:

Stored size: 488 Bytes

Contents

require "logstash/outputs/base"
require "em-mongo"

class LogStash::Outputs::Mongodb < LogStash::Outputs::Base
  def initialize(url, config={}, &block)
    super
  end

  def register
    # Port?
    # Authentication?
    db = @url.path[1..-1] # Skip leading '/'
    @mongodb = EventMachine::Mongo::Connection.new(@url.host).db(db)
  end # def register

  def receive(event)
    @mongodb.collection("events").insert(event.to_hash)
  end # def event
end # class LogStash::Outputs::Mongodb

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
logstash-lite-0.2.20101222161646 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101208111718 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101207114354 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101201111523 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101129210156 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101129205551 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101129155412 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101124030048 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101124004656 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101123134625 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101123133737 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101120024757 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101120021802 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101119183130 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101118141920 lib/logstash/outputs/mongodb.rb
logstash-lite-0.2.20101118134500 lib/logstash/outputs/mongodb.rb