已安装Logstash插件但未找到

时间:2016-08-22 16:43:20

标签: rubygems logstash

我正在使用logstash 2.3.2,对于我的一个项目,我必须在RAM中保存一些数据。我在stackoverflow(Logstash: is it possible to save documents in memory?)上提出了一个问题来获取一个过滤器,并且最合适的过滤器是memcached(即使这个是非官方的)。

我下载了插件,我生成了gem文件(不是空的),我成功安装了插件。

enter image description here

但是,当我在配置文件中使用此过滤器运行logsatsh时,出现以下错误:

:reason=>"Couldn't find any filter plugin named 'memcached'. Are you sure this is correct? Trying to load the memcached filter plugin resulted in this error: no such file to load -- logstash/filters/memcached", :level=>:error}

此外,当我使用命令bin / logstah-plugin list时,不存在过滤器memcached。

我不明白为什么会这样。我跟着这个讨论(https://discuss.elastic.co/t/logstash-plugin-installed-but-not-found/24369)但没有成功!

那么,你知道如何解决这个问题吗?

感谢您的关注和帮助。

1 个答案:

答案 0 :(得分:2)

这是要遵循的过程:

一个。在logstash-filter-cache-memcached.gemspec修改此行

s.add_runtime_dependency 'logstash-core', '>= 1.4.0', '< 2.0.0'

s.add_runtime_dependency 'logstash-core', '>= 1.4.0', '< 3.0.0'

B中。运行以下命令来构建插件

> gem build logstash-filter-cache-memcached.gemspec  

℃。在logstash文件夹中,安装插件:

> bin/logstash-plugin install /path/to/logstash-filter-cache-memcached/logstash-filter-cache-memcached-0.1.1.gem 

那应该产生这个:

Validating /path/to/logstash-filter-cache-memcached/logstash-filter-cache-memcached-0.1.1.gem
Installing logstash-filter-cache-memcached
Installation successful

d。验证您的插件是否已正确安装

> bin/logstash-plugin list | grep cache
logstash-filter-cache-memcached

电子。运行快速测试,看看是否有效:

> bin/logstash -t -e 'input{stdin{}} filter {memcached{namespace => "test" host => "localhost:11211" key => "test" field => "message" ttl=>60}} output {stdout{}}'

你应该看到这个:

memcached plugin doesn't have a version. This plugin isn't well
 supported by the community and likely has no maintainer. {:level=>:warn}
Configuration OK