java - 如何启用流利的插件
问题描述
我正在使用 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' 查找插件"
解决方案
添加到 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>
推荐阅读
- sql - SQL Server 监视旧应用程序中的数据插入、更新和删除
- c# - 当我执行“构建>清洁解决方案”时,我想将所有“.proto”文件从一个目录复制到另一个目录]
- ruby - 如何对其中包含值的哈希进行排序
- google-colaboratory - 尝试连接到 Google Colab 上的托管运行时
- rust - 如何使用相同的可变借用两次调用 serde_json::to_writer?
- javafx - 在 Java 7 中使用当前年份从组合框中获取所选月份的开始日期和结束日期
- c++ - 如何使用 `execl()` 在 C/C++ 中运行系统命令,仅将函数参数作为命令行而不是可执行文件传递?
- tfs - 为什么“远程机器上的 Powershell”任务会在执行内联脚本之前暂停 30 秒?
- python - 如何使用flask框架在html页面中动态显示python图表
- kotlin - 为什么不推荐使用 Kotlin 通道上的流操作?