流利的加载自定义解析器失败

时间:2019-12-23 14:54:36

标签: fluentd

fluentd无法与我的自定义解析器一起运行:

我的解析器名为dn_multiline_parser,位于lib/fluent/plugin/parser_dn_log.rb

require 'fluent/plugin/parser'

# default format: "%time [%level] %message"

module Fluent
  module Plugin
    class DnLogParser < Parser
      Plugin.register_parser('dn_multiline_parser', self)
      ... (parser impl)
    end
  end
end

fluentd.conf:

    <worker 0>
      <source>
        @type tail
        # path /external/core/traces/*/*
        tag dn.traces
        path /core/dn_gen*
        path_key logfile
        pos_file /tmp/traces.position.traces
        tag dn.traces
        rotate_wait 5
        read_from_head true
        multiline_flush_interval 5s
        read_lines_limit 100000
        refresh_interval 1
        exclude_path ["*.gz","*.zip","*.backup"]
        <parse>
            @type dn_multiline_parser
            time_key dn_timestamp
            log_format "%t [%l] %m"
            time_length 23
            time_format %Y-%m-%d %H:%M:%S
        </parse>
      </source>
    </worker>
... (rest of configuration)

流利的我得到:

  

2019-12-23 14:32:24 +0000 [错误]:配置错误文件=“ / etc / fluent / fluent.conf” error_class = Fluent :: ConfigError error =“未知的解析器插件'dn_multiline_parser'。运行'gem search -rd fluent-plugin'查找插件”

我尝试过的事情:

  1. 使用'-p / path / to / plugin_folder'运行流利,但由于上述错误而失败
  2. 构建一个gem,安装它,并且不带'-p'即可流畅运行,并且由于上述错误而失败(我的插件存在于'gem list'输出中)

有什么想法我做错了吗?

0 个答案:

没有答案