在一个VM中,我使用了/etc/rsyslog.d/50-default.conf中的
*.* @192.168.29.1:42185
# Default rules for rsyslog.在流畅的vm上,我有以下几点:
我在/etc/td-agent/td-agent.conf里有这个
<source>
type syslog
port 42185
tag rsyslog
</source>
<match rsyslog.**>
type copy
<store>
# for debug (see /var/log/td-agent.log)
type stdout
</store>
<store>
type elasticsearch
logstash_format true
flush_interval 10s # for testing.
</store>
</match>但是,在我查看/var/log/td-agent.log时,似乎没有任何东西被发送到远程计算机。
2014-08-08 10:51:10 -0700 [info]: adding source type="syslog"
2014-08-08 10:51:10 -0700 [info]: adding source type="forward"
2014-08-08 10:51:10 -0700 [info]: adding source type="http"
2014-08-08 10:51:10 -0700 [info]: adding source type="debug_agent"
2014-08-08 10:51:10 -0700 [info]: adding match pattern="td.*.*" type="tdlog"
2014-08-08 10:51:10 -0700 [info]: adding match pattern="debug.**" type="stdout"
2014-08-08 10:51:10 -0700 [info]: adding match pattern="rsyslog.**" type="copy"
2014-08-08 10:51:10 -0700 [info]: listening fluent socket on 0.0.0.0:24224
2014-08-08 10:51:10 -0700 [info]: listening dRuby uri="druby://127.0.0.1:24230" object="Engine"
2我不知道为什么没有发送日志,我也不知道如何判断rsyslog是否出了问题,它只是没有发送文件。
发布于 2014-08-09 18:24:55
如果我没有弄错,rsyslog将通过TCP转发日志(在配置文件中,这被列为“可靠性”),但是fluentD的侦听器默认在UDP上侦听。对fluentD配置的此更改应允许您接收TCP上的日志:
<source>
type syslog
port 42185
protocol_type tcp
tag rsyslog
</source>如果您在进行此更改后仍未接收日志,则我将与TCP转储检查代理上是否正在接收流量:
tcpdump -i any port 42185这还应该表明是否正在接收TCP或UDP (仅指定port,而不是tcp或udp )。
编辑:除此之外,确保您的rsyslog配置是正确的:我见过和使用过的所有示例,在前进规则中都有一个双@@:
*.* @@192.168.29.1:42185http://www.rsyslog.com/doc/rsyslog_可靠_forwarding.html
https://serverfault.com/questions/619082
复制相似问题