在这个系统上,我有calyptia-fluentd,并且我正在尝试开发一个自定义过滤器插件。
首先,我使用一些初始代码创建了一个 gem,并且安装了这个 gem,并使用该插件创建了一个配置文件。
但是,calyptia-fluentd从命令行启动(环境是安装程序提供的环境,而不是通用的 Windows 命令提示符)会出现以下情况:
C:\opt\calyptia-fluentd>calyptia-fluentd -vv
2022-08-11 16:24:23 +0200 [info]: fluent/log.rb:330:info: parsing config file is succeeded path="C:\\opt\\calyptia-fluentd\\bin\\\\..\\etc\\calyptia-fluentd\\calyptia-fluentd.conf"
2022-08-11 16:24:23 +0200 [info]: fluent/log.rb:330:info: gem 'fluentd' version '1.15.0'
2022-08-11 16:24:23 +0200 [info]: fluent/log.rb:330:info: gem 'fluent-plugin-calyptia-monitoring' version '0.1.3'
...
2022-08-11 16:24:23 +0200 [info]: fluent/log.rb:330:info: gem 'fluent-plugin-custom' version '0.0.3'
...
2022-08-11 16:24:23 +0200 [info]: fluent/log.rb:330:info: gem 'fluent-plugin-windows-eventlog' version '0.8.1'
2022-08-11 16:24:23 +0200 [error]: fluent/log.rb:372:error: config error file="C:\\opt\\calyptia-fluentd\\bin\\\\..\\etc\\calyptia-fluentd\\calyptia-fluentd.conf" error_class=Fluent::NotFoundPluginError error="Unknown filter plugin 'filter_custom'. Run 'gem search -rd fluent-plugin' to find plugins"
Run Code Online (Sandbox Code Playgroud)
请注意,它说它已加载fluent-plugin-customgem,但随后它会因“未知插件”错误而崩溃。
插件代码,放置在filter_custom.rb:
module Fluent::Plugin
class CustomFilter < Filter
Fluent::Plugin.register_filter('custom', self)
# ...
def filter(tag, time, record)
record
end
# ...
end
end
Run Code Online (Sandbox Code Playgroud)
我也试过把它放在/etc/calyptia-fluentd/pluginLinux系统上,也有同样的问题。
如何让 Fluentd 使用新插件?
| 归档时间: |
|
| 查看次数: |
386 次 |
| 最近记录: |