我刚开始使用Logstash。我已经能够使用内置插件(例如ruby-debug
和csv
)来运行它。我现在正在尝试创建自定义插件,并在教程here
我开始安装插件的步骤。我的插件位于$ LS_HOME / plugins / logstash-output-example / so,从$ LS_HOME,我跑了
bin/plugin install plugins/logstash-output-example/logstash-output-example-0.1.3.gem
给了我这个输出
Validating plugins/logstash-output-example/logstash-output-example-0.1.3.gem
Installing logstash-output-example
Installation successful
我很满意。为了测试我跑
bin/logstash -e 'input { stdin {} } output { example{} }';
给了我
The error reported is:
Couldn't find any output plugin named 'example'. Are you sure this is correct?
Trying to load the example output plugin resulted in this error: no such file to load -- logstash/outputs/example
然后我很伤心。我做错了什么?
供参考,这是插件代码
# encoding: utf-8
require "logstash/outputs/base"
require "logstash/namespace"
# An example output that does nothing.
class LogStash::Outputs::Example < LogStash::Outputs::Base
config_name "example"
public
def register
end # def register
public
def receive(event)
return "Event received"
end # def event
end # class LogStash::Outputs::Example
答案 0 :(得分:0)
你应该在你的Gemfile中看到,如果你的插件示例在那里,否则你的插件没有正确安装!