简体   繁体   English

logstash 5.1.2上的logstash-input-mongodb错误

[英]logstash-input-mongodb errors on logstash 5.1.2

I'm trying to run the plugin on logstash 5.1.2, and getting the error: Direct event field references (ie event['field'] = 'value') have been disabled in favor of using event get and set methods (eg event.set('field', 'value')). 我正在尝试在Logstash 5.1.2上运行插件,并得到以下错误: 为了使用事件get和set方法(例如,直接事件字段引用(即event ['field'] ='value'))已被禁用event.set('field','value'))。 Please consult the Logstash 5.0 breaking changes documentation for more details. 有关更多详细信息,请查阅Logstash 5.0重大更改文档。

19:20:09.456 [LogStash::Runner] INFO logstash.inputs.mongodb - Using version 0.1.x input plugin 'mongodb'. 19:20:09.456 [LogStash :: Runner]信息logstash.inputs.mongodb-使用版本0.1.x的输入插件'mongodb'。 This plugin isn't well supported by the community and likely has no maintainer. 该插件没有得到社区的很好支持,并且可能没有维护者。

D, [2017-02-09T19:20:09.766000 #7068] DEBUG -- : MONGODB | D,[2017-02-09T19:20:09.766000#7068]调试-:MONGODB | Adding localhost:27017 to the cluster. 将localhost:27017添加到集群。 | | runtime: 0.0000ms 运行时间:0.0000ms

D, [2017-02-09T19:20:12.839000 #7068] DEBUG -- : MONGODB | D,[2017-02-09T19:20:12.839000#7068]调试-:MONGODB | COMMAND | COMMAND | namespace=admin.$cmd selector={:ismaster=>1} flags=[] limit=-1 skip=0 project=nil | 名称空间= admin。$ cmd选择器= {:ismaster => 1}标志= []限制= -1跳过= 0项目=无| runtime: 3066.0000ms 19:20:12.845 [[main]-pipeline-manager] INFO logstash.inputs.mongodb - Registering MongoDB input 运行时:3066.0000ms 19:20:12.845 [[main] -pipeline-manager] INFO logstash.inputs.mongodb-注册MongoDB输入

D, [2017-02-09T19:20:12.936000 #7068] DEBUG -- : MONGODB | D,[2017-02-09T19:20:12.936000#7068]调试-:MONGODB | COMMAND | COMMAND | namespace=test.$cmd selector={:listCollections=>1, :cursor=>{}, :filter=>{:name=>{"$not"=>/system.|\\$/}}} flags=[:slave_ok] limit=-1 skip=0 project=nil | namespace = test。$ cmd选择器= {:listCollections => 1,:cursor => {},:filter => {:name => {“ $ not” => / system。| \\ $ /}}}标志= [:slave_ok]限制= -1跳过= 0项目=无| runtime: 22.0001ms 19:20:13.140 [[main]-pipeline-manager] INFO logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>500} 19:20:13.151 [[main]-pipeline-manager] INFO logstash.pipeline - Pipeline main started 运行时间:22.0001ms 19:20:13.140 [[main] -pipeline-manager]信息logstash.pipeline-启动管道{“ id” =>“ main”,“ pipeline.workers” => 4,“ pipeline.batch.size “ => 125,” pipeline.batch.delay“ => 5,” pipeline.max_inflight“ => 500} 19:20:13.151 [[main] -pipeline-manager] INFO logstash.pipeline-管道主管道已启动

D, [2017-02-09T19:20:13.356000 #7068] DEBUG -- : MONGODB | D,[2017-02-09T19:20:13.356000#7068]调试-:MONGODB | QUERY | 查询| namespace=test.auditcommunications selector={:_id=>{:$gt=>BSON::ObjectId('0761b057fccc5c277c23dfbe')}} flags=[:slave_ok] limit=50 skip=0 project=nil | 名称空间= test.auditcommunications选择器= {:_id => {:$ gt => BSON :: ObjectId('0761b057fccc5c277c23dfbe')}}标志= [:slave_ok]限制= 50 skip = 0 project = nil | runtime: 224.9999ms 19:20:13.420 [Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=>9600} 19:20:13.647 [[main] 运行时:224.9999ms 19:20:13.420 [Api Web服务器] INFO logstash.agent-成功启动Logstash API端点{:port => 9600} 19:20:13.647 [[main]

Plugin: "mongodb://localhost:27017/test", placeholder_db_dir=>"/elk/logstash-mongodb/", placeholder_db_name=>"logstash_sqlite.db", collection=>"auditcommunications", batch_size=>50, id=>"797b2fd78162084f6d57991a196d656a6c95f190-1", enable_metric=>true, codec=>"plain_cd856514-8fcc-43ad-becd-9497e98577b9", enable_metric=>true, charset=>"UTF-8">, since_table=>"logstash_since", parse_method=>"flatten", isodate=>false, retry_delay=>3, generateId=>false, unpack_mongo_id=>false, message=>"Default message...", interval=>1> 插件:“ mongodb:// localhost:27017 / test”,placeholder_db_dir =>“ / elk / logstash-mongodb /”,placeholder_db_name =>“ logstash_sqlite.db”,collection =>“ auditcommunications”,batch_size => 50,id = >“ 797b2fd78162084f6d57991a196d656a6c95f190-1”,enable_metric => true,编解码器=>“ plain_cd856514-8fcc-43ad-becd-9497e98577b9”,enable_metric => true,charset =>“ UTF-8”>,since_table =>“ logstash_method”,parse =>“拼合”,isodate => false,retry_delay => 3,generateId => false,unpack_mongo_id => false,消息=>“默认消息...”,间隔=> 1>

Error: Direct event field references (ie event['field'] = 'value') have been disabled in favor of using event get and set methods (eg event.set('field', 'value')). 错误:直接事件字段引用(即event ['field'] ='value')已被禁用,有利于使用事件get和set方法(例如event.set('field','value'))。 Please consult the Logstash 5.0 breaking changes documentation for more details. 有关更多详细信息,请查阅Logstash 5.0重大更改文档。

D, [2017-02-09T19:20:14.782000 #7068] DEBUG -- : MONGODB | D,[2017-02-09T19:20:14.782000#7068]调试-:MONGODB | QUERY | 查询| namespace=test.auditcommunications selector={:_id=>{:$gt=>BSON::ObjectId('0761b057fccc5c277c23dfbe')}} flags=[:slave_ok] limit=50 skip=0 project=nil | 名称空间= test.auditcommunications选择器= {:_id => {:$ gt => BSON :: ObjectId('0761b057fccc5c277c23dfbe')}}标志= [:slave_ok]限制= 50 skip = 0 project = nil | runtime: 128.9999ms 运行时间:128.9999ms

(sorry about the formatting) (对不起格式)

My configuration is pretty much copy pasted from the instructions: 我的配置几乎是从说明中粘贴的:

input {
  mongodb {
    uri => 'mongodb://localhost:27017/test'
    placeholder_db_dir => '/elk/logstash-mongodb/'
    placeholder_db_name => 'logstash_sqlite.db'
    collection => 'auditcommunications'
    batch_size => 50
  }
}

filter {
  date {
    match => [ "timestamp", "ISO8601" ]
  }
}

output {
    stdout { codec => rubydebug }
}

Am I doing something wrong or is there a problem with this plugin? 我是在做错什么,还是这个插件有问题?

You're using version 0.1.x of logstash-input-mongodb , which is an old version. 您正在使用logstash-input-mongodblogstash-input-mongodb版本,这是一个旧版本。 You should use the latest 0.4.0 version which is compatible with Logstash 5 thanks to PR #53 . 由于PR#53,您应该使用与Logstash 5兼容的最新0.4.0版本。

You can try to update your plugin with: 您可以尝试使用以下方法更新插件:

bin/logstash-plugin update logstash-input-mongodb

When done, run the following command and make sure that logstash-input-mongodb 0.4.0 is installed. 完成后,运行以下命令并确保已安装logstash-input-mongodb 0.4.0。

bin/logstash-plugin list --verbose

Then your plugin will work again. 然后您的插件将再次运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM