Skip to content

Commit f6d3a73

Browse files
authored
Fix "wrong number of arguments" error when shipping events to MongoDB (fixes logstash-plugins#60, logstash-plugins#64, logstash-plugins#65) (logstash-plugins#66)
Add missing second argument to to_bson methods, introduced with underlying Mongo driver update (fixes issues logstash-plugins#60, logstash-plugins#64, logstash-plugins#65)
1 parent a969cee commit f6d3a73

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 3.1.7
2+
- Fix "wrong number of arguments" error when shipping events to MongoDB (fixes #60, #64, #65) [#66](https://github.com/logstash-plugins/logstash-output-mongodb/pull/66)
3+
14
## 3.1.6
25
- Fixes BigDecimal and Timestamp encoding and update driver to v2.6 [#59](https://github.com/logstash-plugins/logstash-output-mongodb/pull/59)
36

lib/logstash/outputs/bson/big_decimal.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module BigDecimal
3333
# 1.221311.to_bson
3434
# @return [ String ] The encoded string.
3535
# @see http://bsonspec.org/#/specification
36-
def to_bson(buffer = ByteBuffer.new)
36+
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
3737
buffer.put_bytes([ self ].pack(PACK))
3838
end
3939

lib/logstash/outputs/bson/logstash_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module LogStashEvent
3030
# Event.new("field" => "value").to_bson
3131
# @return [ String ] The encoded string.
3232
# @see http://bsonspec.org/#/specification
33-
def to_bson(buffer = ByteBuffer.new)
33+
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
3434
position = buffer.length
3535
buffer.put_int32(0)
3636
to_hash.each do |field, value|

lib/logstash/outputs/bson/logstash_timestamp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module LogStashTimestamp
2525
# A time is type 0x09 in the BSON spec.
2626
BSON_TYPE = 9.chr.force_encoding(BINARY).freeze
2727

28-
def to_bson(buffer = ByteBuffer.new)
28+
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
2929
time.to_bson(buffer)
3030
end
3131

logstash-output-mongodb.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'logstash-output-mongodb'
3-
s.version = '3.1.6'
3+
s.version = '3.1.7'
44
s.licenses = ['Apache License (2.0)']
55
s.summary = "Writes events to MongoDB"
66
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"

0 commit comments

Comments
 (0)