使用logstash elasticsearch的mongodb输入插件

时间:2015-08-06 10:15:03

标签: mongodb elasticsearch logstash

运行conf文件时出现此错误

D:\elastic search\logstash-1.5.3\bin>logstash -f mongo.conf
io/console not supported; tty will not be manipulated
Warning: No private key present, creating unsigned gem.
The error reported is:
  No connection string specified

这是我的conf文件

input {
  mongodb {
    uri => 'mongodb://root:root@localhost:27017/mydb'
    path => '/opt/logstash-mongodb/logstash_sqlite.db'
    collection => 'bike'
    port => 27017
    unpack_mongo_id => true
    batch_size => 5000
  }
}

2 个答案:

答案 0 :(得分:0)

已经在主机(localhost:27017)之后用端口指定的URI,不需要"端口"再次。尝试使用SSL作为mongodb://用户名:密码@ host:port / db?ssl = true

答案 1 :(得分:0)

提供authSourceplaceholder_db_dirplaceholder_db_name如下:

input {
  mongodb {
    uri => 'mongodb://root:root@localhost:27017/mydb?authSource=admin'
    placeholder_db_dir => 'C:\ELK\logstash-5.3.0\data'
    placeholder_db_name => 'logstash_sqlite.db'
    collection => 'bike'
    unpack_mongo_id => true
    batch_size => 5000
  }
}