Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Cloudwatch log stream name not recognised

Tags:

So,

I'm using the automated logging from AWS Lambda. It generates log streams with names that look like this: 2016/05/18/[$LATEST]99577d10a8cb420cb124a90c20d5653a

I can query, using 'aws logs describe-log-streams', the available log streams and get some JSON containing these names alongside other meta data.

However if I then try to do this:

aws logs get-log-events --log-group-name /aws/lambda/categorise --log-stream-name "2016/05/18/[$LATEST]99577d10a8cb420cb124a90c20d5653a"

I get an error

A client error (ResourceNotFoundException) occurred when calling the GetLogEvents operation: The specified log stream does not exist.

So if the log stream name returned by the describe log streams command doesn't actually exist. What is it?

I've tried hacking around with the command a bit, removing the [$LATEST], quoting it, escaping it. But no joy. Has anyone managed to retrieve their Lambda log events using the aws cli?

like image 300
aychedee Avatar asked May 18 '16 08:05

aychedee


People also ask

What is log stream name in CloudWatch?

A log stream is a sequence of log events that share the same source. Each separate source of logs in CloudWatch Logs makes up a separate log stream. A log group is a group of log streams that share the same retention, monitoring, and access control settings.

What is log stream name in AWS?

AWS::Logs::LogStream You must use the following guidelines when naming a log stream: Log stream names must be unique within the log group. Log stream names can be between 1 and 512 characters long. The ':' (colon) and '*' (asterisk) characters are not allowed.

Where is AWS log stream?

The log groups for the current AWS Region are displayed under the CloudWatch Logs node. To view the log streams in a log group, do one of the following: Double-click the name of the log group. Right-click the name of the log group, and then choose View Log Streams.


1 Answers

Immediately after posting this I figured it out... The $ in [$LATEST] needs to be escaped... So it should look something like [\$LATEST].

like image 132
aychedee Avatar answered Sep 24 '22 09:09

aychedee