Class: DocumentParser
- Inherits:
-
Object
- Object
- DocumentParser
- Defined in:
- lib/mongo/mongo.rb
Instance Method Summary collapse
-
#initialize(host) ⇒ DocumentParser
constructor
A new instance of DocumentParser.
- #parse(document) ⇒ Object
Constructor Details
#initialize(host) ⇒ DocumentParser
Returns a new instance of DocumentParser.
47 48 49 |
# File 'lib/mongo/mongo.rb', line 47 def initialize(host) @host = host end |
Instance Method Details
#parse(document) ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/mongo/mongo.rb', line 51 def parse(document) event = LogStash::Event.new('host' => @host) document.each do |key, value| event.set(key, value) end event end |