Hi,
I am able to write to a file or use other outputs. My problem is specific to the mongodb output use case.
centos7
MongoDB shell version: 3.2.10
logstash-output-mongodb 2.0.5
winlogbeats 1.3.1
logstash 2.4.0
logstash config:
mongodb {
collection => "mycollection"
database => "mydb"
uri => "mongodb://localhost"
}
I have created a database and a collection. Also able to manually write to it. No authentication required.
This is glaring in the log ----- NoMethodError: undefined method `bson_type' for #Java::JavaUtil::LinkedHashMap:0x7aa06858
ERROR:
@metadata_accessors=#<LogStash::Util::Accessors:0x6b5e4761 @store={}, @lut={}>, @cancelled=false>, :exception=>#<NoMethodError: undefined method bson_type' for #<Java::JavaUtil::LinkedHashMap:0x7aa06858>>, :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/hash.rb:44:in
to_bson'", "org/jruby/RubyHash.java:1342:in each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/hash.rb:43:in
to_bson'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/encodable.rb:57:in encode_with_placeholder_and_null'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/hash.rb:42:in
to_bson'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/array.rb:49:in to_bson'", "org/jruby/RubyArray.java:1613:in
each'", "org/jruby/RubyEnumerable.java:974:in each_with_index'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/array.rb:46:in
to_bson'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/encodable.rb:57:in encode_with_placeholder_and_null'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/array.rb:45:in
to_bson'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/hash.rb:46:in to_bson'", "org/jruby/RubyHash.java:1342:in
each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/hash.rb:43:in to_bson'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/encodable.rb:57:in
encode_with_placeholder_and_null'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/bson-3.2.6-java/lib/bson/hash.rb:42:in to_bson'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/protocol/serializers.rb:155:in
serialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/protocol/message.rb:153:in serialize_fields'", "org/jruby/RubyArray.java:1613:in
each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/protocol/message.rb:141:in serialize_fields'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/protocol/message.rb:70:in
serialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connection.rb:123:in write'", "org/jruby/RubyArray.java:1613:in
each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connection.rb:122:in write'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connectable.rb:66:in
dispatch'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/loggable.rb:44:in log'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/loggable.rb:43:in
log'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/loggable.rb:67:in log_debug'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connectable.rb:65:in
dispatch'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/executable.rb:35:in execute'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connection_pool.rb:99:in
with_connection'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/connection_pool.rb:97:in with_connection'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server/context.rb:63:in
with_connection'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/executable.rb:34:in execute'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/write/insert.rb:72:in
execute_write_command'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/operation/write/insert.rb:62:in execute'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/collection.rb:190:in
insert_many'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/collection.rb:175:in insert_one'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-mongodb-2.0.5/lib/logstash/outputs/mongodb.rb:56:in
receive'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-<TRUNCTATED
Please assist me.
Thank you,
Rivaan