Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudwatch logs - No Event Data after time elapses

I've looked on the AWS forums and elsewhere but haven't found a solution. I have a lambda function that, when invoked, creates a log stream which populates with log events. After about 12 hours or so, the log stream is still present, but when I open it, I see the following:

No Event Data

The link explains how to start sending event data, but I already have this set up, and I am sending event data, it just disappears after a certain time period.

I'm guessing there is some setting somewhere (either for max storage allowed or for whether logs get purged), but if there is, I haven't found it.

like image 570
aceofbassgreg Avatar asked Nov 08 '22 11:11

aceofbassgreg


1 Answers

Another reason for missing data in the log stream might be a corrupted agent-state file. First check your logs

vim /var/log/awslogs.log

If you find something like "Caught exception: An error occurred (InvalidSequenceTokenException) when calling the PutLogEvents operation: The given sequenceToken is invalid. The next expected sequenceToken is:" you can regenerate the agent-state file as follows:

sudo rm /var/lib/awslogs/agent-state
sudo service awslogs stop
sudo service awslogs start
like image 111
Greg Holst Avatar answered Nov 15 '22 12:11

Greg Holst