我有兩個包含多行日誌語句的日誌文件。他們兩個在每個日誌語句的開頭都有相同的日期時間格式。配置是這樣的:CloudWatch日誌表現怪異
state_file = /var/lib/awslogs/agent-state
[/opt/logdir/log1.0]
datetime_format = %Y-%m-%d %H:%M:%S
file = /opt/logdir/log1.0
log_stream_name = /opt/logdir/logs/log1.0
initial_position = start_of_file
multi_line_start_pattern = {datetime_format}
log_group_name = my.log.group
[/opt/logdir/log2-console.log]
datetime_format = %Y-%m-%d %H:%M:%S
file = /opt/logdir/log2-console.log
log_stream_name = /opt/logdir/log2-console.log
initial_position = start_of_file
multi_line_start_pattern = {datetime_format}
log_group_name = my.log.group
的CloudWatch的日誌代理正確發送log1.0日誌我的日誌組對CloudWatch的,然而,它不發送日誌文件的log 2-的console.log。
awslogs.log說:
2016-11-15 08:11:41,308 - cwlogs.push.batch - WARNING - 3593 - Thread-4 - Skip event: {'timestamp': 1479196444000, 'start_position': 42330916L, 'end_position': 42331504L}, reason: timestamp is more than 2 hours in future.
2016-11-15 08:11:41,308 - cwlogs.push.batch - WARNING - 3593 - Thread-4 - Skip event: {'timestamp': 1479196451000, 'start_position': 42331504L, 'end_position': 42332092L}, reason: timestamp is more than 2 hours in future.
雖然服務器的時間是正確的。另外奇怪的是start_position中提到的行號和end_position在實際的日誌文件被推入時不存在。
任何其他人遇到此問題?
我有同樣的效果,仍然在尋找解決方案。重新啓動服務沒有幫助。 BTW:start_position和end_position不是行號,而是字節位置。 –