AWS Cloudwatch log stream name not recognised

 ̄綄美尐妖づ 提交于 2019-12-06 17:45:34

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/37294263/aws-cloudwatch-log-stream-name-not-recognised

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!