Class: LogStash::Outputs::Mongodb
- Inherits:
-
Base
- Object
- Base
- LogStash::Outputs::Mongodb
show all
- Defined in:
- lib/logstash/outputs/mongodb.rb
Instance Attribute Summary
Attributes inherited from Base
#logger
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#receive(event) ⇒ Object
16
17
18
|
# File 'lib/logstash/outputs/mongodb.rb', line 16
def receive(event)
@mongodb.collection(@collection).insert(event.to_hash)
end
|
#register ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/logstash/outputs/mongodb.rb', line 7
def register
unused, @db, @collection = @url.path.split("/", 3)
@mongodb = EventMachine::Mongo::Connection.new(@url.host).db(@db)
end
|