diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e03cde..d5752ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ -## #unreleased +## 3.1.8 + - Fix tests failture for ELASTIC_STACK_VERSION=8.x. Fail message: undefined method `validating_keys?' for BSON::Config:Module + - Fix MongoDB connection error - Failed to handshake [#88] https://github.com/logstash-plugins/logstash-output-mongodb/issues/88 - Fix: Fix failing test spec on jruby-9.3.4.0 [#81](https://github.com/logstash-plugins/logstash-output-mongodb/pull/81) ## 3.1.7 diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 49e2484..c153bdd 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -16,6 +16,7 @@ Contributors: * bitsofinfo (bitsofinfo) * Guy Boertje (guyboertje) * Colin Surprenant (colinsurprenant) +* Vitalii Zavadovskyy Note: If you've sent us patches, bug reports, or otherwise contributed to Logstash, and you aren't on the list above and want to be, please let us know diff --git a/lib/logstash/outputs/bson/big_decimal.rb b/lib/logstash/outputs/bson/big_decimal.rb index 3b5d4ef..d34b373 100644 --- a/lib/logstash/outputs/bson/big_decimal.rb +++ b/lib/logstash/outputs/bson/big_decimal.rb @@ -33,8 +33,8 @@ module BigDecimal # 1.221311.to_bson # @return [ String ] The encoded string. # @see http://bsonspec.org/#/specification - def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?) - buffer.put_bytes([ self ].pack(PACK)) + def to_bson(buffer = ByteBuffer.new, _validating_keys = nil) + buffer.put_bytes([ self ].pack(PACK)) end module ClassMethods @@ -43,7 +43,7 @@ module ClassMethods # @param [ BSON ] bson object from Mongo. # @return [ BigDecimal ] The decoded BigDecimal. # @see http://bsonspec.org/#/specification - def from_bson(bson) + def from_bson(bson, **_options) from_bson_double(bson.get_bytes(8)) end diff --git a/lib/logstash/outputs/bson/logstash_event.rb b/lib/logstash/outputs/bson/logstash_event.rb index 9b4e17c..7e4c27f 100644 --- a/lib/logstash/outputs/bson/logstash_event.rb +++ b/lib/logstash/outputs/bson/logstash_event.rb @@ -30,7 +30,7 @@ module LogStashEvent # Event.new("field" => "value").to_bson # @return [ String ] The encoded string. # @see http://bsonspec.org/#/specification - def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?) + def to_bson(buffer = ByteBuffer.new, _validating_keys = nil) position = buffer.length buffer.put_int32(0) to_hash.each do |field, value| @@ -55,7 +55,7 @@ module ClassMethods # @param [ ByteBuffer ] buffer The byte buffer. # @return [ Event ] The decoded bson document. # @see http://bsonspec.org/#/specification - def from_bson(buffer) + def from_bson(buffer, **_options) hash = Hash.new buffer.get_int32 # Throw away the size. while (type = buffer.get_byte) != NULL_BYTE diff --git a/lib/logstash/outputs/bson/logstash_timestamp.rb b/lib/logstash/outputs/bson/logstash_timestamp.rb index 6eae0f0..ad1d5f4 100644 --- a/lib/logstash/outputs/bson/logstash_timestamp.rb +++ b/lib/logstash/outputs/bson/logstash_timestamp.rb @@ -25,7 +25,7 @@ module LogStashTimestamp # A time is type 0x09 in the BSON spec. BSON_TYPE = 9.chr.force_encoding(BINARY).freeze - def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?) + def to_bson(buffer = ByteBuffer.new, _validating_keys = nil) time.to_bson(buffer) end @@ -34,7 +34,7 @@ module ClassMethods # @param [ BSON ] bson encoded time. # @return [ ::LogStash::Timestamp ] The decoded UTC time as a ::LogStash::Timestamp. # @see http://bsonspec.org/#/specification - def from_bson(bson) + def from_bson(bson, **_options) seconds, fragment = BSON::Int64.from_bson(bson).divmod(1000) new(::Time.at(seconds, fragment * 1000).utc) end diff --git a/logstash-output-mongodb.gemspec b/logstash-output-mongodb.gemspec index b2cd699..f9d1c2c 100644 --- a/logstash-output-mongodb.gemspec +++ b/logstash-output-mongodb.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'logstash-output-mongodb' - s.version = '3.1.7' + s.version = '3.1.8' s.licenses = ['Apache License (2.0)'] s.summary = "Writes events to MongoDB" 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"