繁体   English   中英

文件流利的日志收集器

[英]Fluentd log collector from file

我需要从由应用程序创建的数据文件中收集数据。 日志文件位于“ /var/log/payment-service.log”中。 该应用程序在9100端口中运行。

我已经在/etc/td-agent/td-agent.conf中添加了配置。 配置如下

# Receive events from 24224/tcp
# This is used by log forwarding and the fluent-cat command
<source>
  @type forward
  port 9100
</source>

# http://this.host:9880/myapp.access?json={"event":"data"}
<source>
  @type http
  port 9880
</source>

我试图从这样的休息电话中获取日志

http://localhost:9880/myapp.access?json={event:data}

但是我无法从该网址获得任何结果。

请帮助任何人解决此问题。

提前致谢。

您可以使用in_tail插件读取日志文件“ /var/log/payment-service.log”。

<source>
  @type tail
  path /var/log/payment-service.log
  pos_file /tmp/payment-service.log.pos
  tag payment-service.log
  <parse>
    # parse your logs
  </parse>
</source>

<match payment-service.log>
  @type stdout
</match>

您不能使用in_forward插件读取日志文件,也不能使用in_http插件从Fluentd获取日志。

请仔细阅读链接的文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM