elasticsearch fluentd聚合器未从转发器获取日志,配置是否正确?,elasticsearch,kibana,fluentd,elasticsearch,Kibana,Fluentd" /> elasticsearch fluentd聚合器未从转发器获取日志,配置是否正确?,elasticsearch,kibana,fluentd,elasticsearch,Kibana,Fluentd" />

elasticsearch fluentd聚合器未从转发器获取日志,配置是否正确?

elasticsearch fluentd聚合器未从转发器获取日志,配置是否正确?,elasticsearch,kibana,fluentd,elasticsearch,Kibana,Fluentd,我目前正在尝试设置fluentd的转发器和聚合器实例系统。 我的转发器配置为-> <source> @type tail format json path /app/node-apps/something-fe/logs/itt-logs.log tag td.pm2.access </source> ## File output ## match tag=local.** and write to file <match td.pm2.*>

我目前正在尝试设置fluentd的转发器和聚合器实例系统。 我的转发器配置为->

<source>
   @type tail
  format json
  path /app/node-apps/something-fe/logs/itt-logs.log
  tag td.pm2.access
</source>

## File output
## match tag=local.** and write to file
<match td.pm2.*>
  @type file
  path /opt/td-agent/forward/log/fluentd.log
</match>

## Forwarding
## match tag=system.** and forward to another td-agent server
<match td.pm2.*>
  @type forward
  host <hostname>.bc

@型尾
格式json
路径/app/node-apps/something-fe/logs/itt-logs.log
标签td.pm2.access
##文件输出
##匹配标记=本地。**并写入文件
@类型文件
path/opt/td-agent/forward/log/fluentd.log
##转发
##match tag=system.**并转发到另一个td代理服务器
@打字前进
主持人:bc
执行此操作时,我可以看到t forwarder正在此处的转发位置输出日志文件:/opt/td-agent/forward/log/fluentd.log 到目前为止一切都很好!!! 但是当我试图通过上面的匹配转发语法将其导入聚合器时,我在聚合器机器中没有得到任何东西。 请在此处找到我正在使用的fluentd聚合器配置-->


@打字前进
端口24224
打印副本
@类型文件
path/opt/td-agent/log/forward.log
类型弹性搜索
主持人:bc
端口9200
logstash_格式为true
冲洗间隔10s
我正试图使用一个商店复制那里的日志,并将它们转发给elasticsearch。 完全忘记elasticsearch,似乎连日志都没有从转发器填充到聚合器。
我做错什么了吗?聚合器日志显示它正在侦听端口24224上的所有地址。

在转发器上,您有两个相同的匹配模式,并且只执行第一个匹配(配置从上到下运行)。日志正在写入文件系统(/opt/td-agent/forward/log/fluentd.log),但未转发到聚合器

实际上,您已经在聚合器上使用了正确的复制语法,应该将该语法复制到转发器中,并将elasticsearch替换为@forward config to aggregator

<match td.pm2.*>
  type copy
    <store>
    @type file
    path /opt/td-agent/log/forward.log
  </store>
  <store>
    @type forward
    host <hostname>.bc
  </store>
</match>

打印副本
@类型文件
path/opt/td-agent/log/forward.log
@打字前进
主持人:bc
进一步阅读:

我认为有一个打字错误: 在
键入副本之前必须有一个“@”符号。至少,根据我的经验,我可以说我的td代理不允许我在没有“@”符号的情况下重启,所以我认为这是正确的,尽管不是100%确定

@type copy

在上面代码的第二行。

这很有帮助,谢谢,现在我可以看到转发给fluentd的日志了。但我将输入日志解析器设置为json格式。但fluentd似乎在存储/传输json消息时会截断它。你知道吗?除非你的fluentd配置中也有一个过滤动作,否则它不应该截断/删除消息的任何部分。
@type copy