【发布时间】:2019-10-13 15:25:54
【问题描述】:
我正在努力将nginx 访问日志传递给Fluentd 到aws kinesis 到AWS S3 via kinesis firehose。 nginx 日志将在log rotation 期间推送到AWS Glacier。
我正处于需要通过 syslog/rsyslog 将 nginx 访问日志传递给 fluentd 的初始步骤。
使用的 Nginx 版本是 1.14。
我的操作系统是:
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
有很多方法可以将 nginx 日志推送到 rsyslog。
方式一:使用模块 imfile ,并更新 rsyslog.conf 如https://petermolnar.net/log-nginx-to-rsyslog/所示
方式 2: 更新 nginx.conf 以直接写入 syslog。我担心这会在高流量期间减慢 nginx 的速度。 https://docs.nginx.com/nginx/admin-guide/monitoring/logging/#logging-to-syslog
方式3:跳过rsyslog/syslog,直接通过模块https://github.com/fluent/nginx-fluentd-module将数据从nginx传递到fluentd。在这里,我担心这个模块是否可靠,以及是否 nginx 不应该因为使用这个模块而变得不那么响应。
实现目标的最佳方式是什么,目标是实时的 从 nginx 访问日志到 fluentd 的数据流,不阻塞 nginx 服务请求。
【问题讨论】:
-
等待回复
标签: apache nginx amazon-kinesis fluentd rsyslog