【发布时间】:2021-02-07 21:14:07
【问题描述】:
我想在 gcp 日志浏览器中显示 redis 日志。为此,我按照https://www.fluentd.org 在具有redis 日志的gcp 实例上安装了fluentd。然后我配置了 td-agent.conf 如下:
<source>
@type tail
format none
path /var/log/redis/*.log
pos_file /var/log/td-agent/pos/redis-server-log.pos
read_from_head true
<parse>
@type syslog
</parse>
tag redis
</source>
<filter **>
@type add_insert_ids
insert_id_key uniq_id # Optional.
</filter>
<match **>
@type google_cloud
</match>
/var/log/redis/redis.log的格式为:
40165:M 28 Jan 2021 16:06:57.699 - 0 clients connected (0 replicas), 1449680 bytes in use
40165:M 28 Jan 2021 16:07:02.720 - 0 clients connected (0 replicas), 1449680 bytes in use
40165:M 28 Jan 2021 16:07:05.592 - Accepted 127.0.0.1:40696
不知何故,我在 gcp 日志记录中看不到 redis 日志。我怀疑部分 td-agent.conf 不应该是 syslog。但是我应该使用什么解析器来解析redis日志?
【问题讨论】:
标签: google-cloud-platform redis fluentd