首页 > 解决方案 > 如何启用流利的插件

问题描述

我正在使用 EFK。

有人可以在这里帮助如何启用fluentd插件。

作为我工作的一部分,我安装了以下 3 个插件。

gem install fluent-plugin-concat
gem install fluent-plugin-detect-exceptions
gem install fluent-plugin-detect-exceptions-with-error
gem install fluent-plugin-record-modifier

我在这里看到了安装的宝石列表:

opsmxuser@opsmx-ind-setup:~/docker-compose-efk$ fluent-gem list

*** LOCAL GEMS ***
.
.
fluent-plugin-concat (2.4.0)
fluent-plugin-detect-exceptions (0.0.12)
fluent-plugin-detect-exceptions-with-error (0.0.3)
fluent-plugin-record-modifier (2.0.1)
fluentd (1.6.2, 0.14.25)
.
.

但是这3个插件没有启用。当我们在文件中使用这些配置时,会在容器日志中fluent.conf获取以下错误消息。fluentd

2019-08-05 12:34:55 +0000 [info]: 解析配置文件成功 path="/fluentd/etc/fluent.conf" 2019-08-05 12:34:55 +0000 [error]: config error file="/etc/fluent/fluent.conf" error_class=Fluent::ConfigError error="未知过滤器插件'concat'。运行'gem search -rd fluent-plugin' 查找插件"

2019-08-02 12:46:23 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="未知输出插件'detect_exceptions'。运行'gem search -rd fluent-plugin' 查找插件"

2019-08-05 12:34:55 +0000 [info]: 解析配置文件成功 path="/fluentd/etc/fluent.conf" 2019-08-05 12:34:55 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="未知过滤插件'record_modifier'。运行'gem search -rd fluent-plugin' 查找插件"

标签: javamultilinefluentd

解决方案


添加到 fluentd config @type 复制指令。
下面的例子:

    <match **>
  @type copy
  <store>
    @type exec
    @id load2clickhouse
    command bash /usr/local/bin/insert_ch.sh {{ template "fluentdInsertTable" $ }}
    format json
    <buffer>
      @type memory
      chunk_limit_size 32m
      queue_limit_length 32
      flush_at_shutdown true
      flush_interval 15s
      flush_thread_count 4
    </buffer>
  </store>
  <store>
    @type elasticsearch
    host ip
    port 5044
    logstash_format true
</store>
</match>

推荐阅读