我已经安装了awslogs,它将日志发送到cloudwatch。它正常工作了几个小时,然后突然停止了。
这是来自awslogs.log的日志
2020-07-06 14:58:27,701 - cwlogs.push.reader - WARNING - 23093 - Thread-6 - Fall back to previous event time: {'timestamp': 1594062573000, 'start_position': 85848600L, 'end_position': 85848777L}, previousEventTime: 1594062573000, reason: timestamp could not be parsed from message.
2020-07-06 14:58:27,701 - cwlogs.push.batch - WARNING - 23093 - Thread-6 - Skip event: {'timestamp': 1594062573000, 'start_position': 85848600L, 'end_position': 85848777L}, reason: timestamp is more than 2 hours in future.
2020-07-06 14:58:27,701 - cwlogs.push.reader - WARNING - 23093 - Thread-6 - Fall back to previous event time: {'timestamp': 1594062573000, 'start_position': 85848777L, 'end_position': 85848952L}, previousEventTime: 1594062573000, reason: timestamp could not be parsed from message.
2020-07-06 14:58:27,701 - cwlogs.push.batch - WARNING - 23093 - Thread-6 - Skip event: {'timestamp': 1594062573000, 'start_position': 85848777L, 'end_position': 85848952L}, reason: timestamp is more than 2 hours in future.下面是我在/var/awslogs/etc/config/api.conf中的配置
[/var/log/app.js/api.log]
datetime_format = %Y-%m-%d %H:%M:%S
buffer_duration = 5000
log_stream_name = {hostname}
initial_position = end_of_file
log_group_name = app-js-logs-prod
file = /var/log/app.js/api.log
[/root/.pm2/pm2.log]
datetime_format = %Y-%m-%d %H:%M:%S
buffer_duration = 5000
log_stream_name = {hostname}
initial_position = end_of_file
log_group_name = pm2-logs-prod我找不到为什么会跳过日志。任何帮助都将不胜感激。
编辑:
timedatectl输出:
root@ip-10-0-5-68:/home/ubuntu# timedatectl
Local time: Mon 2020-07-06 15:18:42 UTC
Universal time: Mon 2020-07-06 15:18:42 UTC
RTC time: Mon 2020-07-06 15:18:43
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
systemd-timesyncd.service active: yes我的本地时间应该是IST。我的系统有问题吗?
发布于 2020-07-06 23:12:21
在将请求发送到CloudWatch之前,将根据代理认为的时间对日志文件中已解析的日志执行检查。
您应该首先验证系统时间是否正确(在其当前时区内),并确保日志日期时区与本地时区(这是默认时区)匹配。
如果匹配,则重启cloudwatch代理。
如果仍然不能修复,请遵循此previous post上的一些建议
https://stackoverflow.com/questions/62758916
复制相似问题