PutLogEvents with timeStamp in past breaks Cloudwatch Insights

0

Hello,

I have read and re-read the putLogEvent limitations on all documentation and searched through all the forums, but cannot find a resolution to this problem.

If you use the sdk, on a lambda in this case, to putLogEvents with your own custom messages to cloudwatch, with a timestamp that is not "current" (anything in the past, even a couple hours or minutes), the log will be written to the logStream, BUT, cloudwatch insights will not observe those logs. (so cloudwatch insights cannot be used). Regardless of the timespan filtering in the cloudwatch insights, those logs are "missing". However, if you go back to your function and change the timestamp on the logMessage in the putLogEvents call to be the "current time" rather than the actual time of the log, then they will show up in the Cloudwatch insights.

I have seen others have had this issue with missing logs in insights, and given that you are able to publish logs to cloudwatch with a timestamp in the past, it seems that it is indeed a bug/miss that insights cannot search them. One would think you would be able to query logs in the past. Any resolution or "insight" into this would be greatly appreciated.

another reference: https://stackoverflow.com/questions/65924587/cloudwatch-query-does-not-work-if-timestamp-is-to-previous-date

Edited by: nmattei on Jul 27, 2021 9:53 AM

nmattei
질문됨 3년 전678회 조회
1개 답변
0

This turned out to be an application with varying application server clocks being out of sync

nmattei
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠