Fluentd Sidecar无法将日志发送到Elasticsearch:类型删除已弃用在批量请求中指定类型

bakadevops

我有一个sidecar容器,配置为收集我的应用程序容器的日志。

我首先fleunt.conf使用以下配置进行了测试

<source>
    @type forward
    bind "127.0.0.1"
    port 24224
    <parse>
      @type json
    </parse>
  </source>
  <match app.default>
    @type stdout
  </match>

当我使用跟踪fluentd容器中容器日志时,它工作正常kubectl,我可以看到我的应用程序日志为JSON格式。

现在,我正在尝试将日志发送到elasticsearch这也是我fluent.conf的意思:

<source>
    @type forward
    bind "127.0.0.1"
    port 24224
    <parse>
      @type json
    </parse>
  </source>
  <match app.default>
    @type elasticsearch
    host "elasticsearch_host"
    port 9200
    index_name "app-log"
    user "log_user"
    password xxxxxx
  </match>

流利的容器在pod内运行良好,但无法定义fluetn.conf在Kibana中配置的索引看来索引模式未加载到中elasticsearch

fluentd容器被示出以下警告:

2020-10-22 12:31:10 +0000 [info]: parsing config file is succeeded path="/fluentd/etc/fluent.conf"
2020-10-22 12:31:10 +0000 [info]: gem 'fluent-plugin-elasticsearch' version '4.0.0'
2020-10-22 12:31:10 +0000 [info]: gem 'fluentd' version '1.10.4'
2020-10-22 12:31:12 +0000 [info]: using configuration file: <ROOT>
  <source>
    @type forward
    bind "127.0.0.1"
    port 24224
    <parse>
      @type json
    </parse>
  </source>
  <match app.default>
    @type elasticsearch
    host "elasticsearch_host"
    port 9200
    index_name "app-log"
    user "log_user"
    password xxxxxx
  </match>
</ROOT>
2020-10-22 12:31:12 +0000 [info]: starting fluentd-1.10.4 pid=8 ruby="2.5.8"
2020-10-22 12:31:12 +0000 [info]: spawn command to main:  cmdline=["/usr/bin/ruby", "-Eascii-8bit:ascii-8bit", "/usr/bin/fluentd", "-c", "/fluentd/etc/fluent.conf", "-p", "/fluentd/plugins", "--under-supervisor"]
2020-10-22 12:31:16 +0000 [info]: adding match pattern="app.default" type="elasticsearch"
2020-10-22 12:31:17 +0000 [warn]: #0 Detected ES 7.x: `_doc` will be used as the document `_type`.
2020-10-22 12:31:17 +0000 [info]: adding source type="forward"
2020-10-22 12:31:17 +0000 [warn]: section <parse> is not used in <source> of forward plugin
2020-10-22 12:31:17 +0000 [info]: #0 starting fluentd worker pid=22 ppid=8 worker=0
2020-10-22 12:31:17 +0000 [info]: #0 listening port port=24224 bind="127.0.0.1"
2020-10-22 12:31:17 +0000 [info]: #0 fluentd worker is now running worker=0
warning: 299 Elasticsearch-7.5.0-e9ccaed468e2fac2275a3761849cbee64b39519f "[types removal] Specifying types in bulk requests is deprecated."
warning: 299 Elasticsearch-7.5.0-e9ccaed468e2fac2275a3761849cbee64b39519f "[types removal] Specifying types in bulk requests is deprecated."
warning: 299 Elasticsearch-7.5.0-e9ccaed468e2fac2275a3761849cbee64b39519f "[types removal] Specifying types in bulk requests is deprecated."

我如何摆脱这个警告"[types removal] Specifying types in bulk requests is deprecated."是否有任何其他配置fluent.conf可以帮助我克服这些困难?

我尝试suppress_type_name true在配置中使用,但没有用。

比约恩·马绍尔莱克

suppress_type_name仅在插件版本4.0.10中添加了true的支持https : //github.com/uken/fluent-plugin-elasticsearch/blob/master/History.md#4010

根据日志,您正在运行4.0.0,因此在配置中升级和设置标志应摆脱警告。该警告不应影响批量请求。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

为什么 fluentd-cloudwatch Kube deamonSet 无法将日志从指定目录发送到 cloudwatch?

Springboot将日志发送到fluentd不起作用

Fluentd grep + 输出日志

fluentd如何转换字段类型

FluentD无法在Elasticsearch中写入日志

如何让 Fluentd 写入日志文件

如何使用fluentd收集pod日志并将其发送到elasticsearch?

Fluentd 无法使用 Elasticsearch 创建索引

如何使用 fluentd 解析 kubelet 日志

Fluentd + Kubernetes:根据标签隔离日志

Fluentd-使用python发送json

从fluentd添加elasticsearch中的原始字段

无法在 Fluentd 上运行简单的 Python 脚本

Kubernetes-在AWS EKS Fargate中,如何将日志从一个容器发送到FluentD for Splunk?

如何从Fluentd日志中删除日期时间和标签?

Fluentd-弹性搜索批量大小的配置设置

Fluentd-运送日志文件并保留其格式

Fluentd + golang日志记录应用程序出现错误

是否可以对 fluentd 收集的 kubernetes pod 日志进行分类?

我如何在州长中过滤 fluentD 日志?

Fluentd-运送日志文件并保留其格式

Fluentd在写入Elasticsearch之前未按预期进行过滤

使用 fluentd 和 elasticsearch 进行实时数据同步

无法在 ubuntu 上的 kubernetes 集群中创建 fluentd 容器

将 Fluentd-config 文件复制到 kubernetes pod

Kubernetes:仅将Fluentd安装到名称空间

Graylog与Fluentd

无法通过fluentd / elasticsearch收集所有kubernetes容器/吊舱日志

如何让 fluentd/elasticsearch 将“日志”key_name 解析为来自 kubernetes pod 的 json?