awslogs icon indicating copy to clipboard operation
awslogs copied to clipboard

Don't show logs

Open jordisantamaria opened this issue 3 years ago • 7 comments

Hi, I installed this cli and It's not returning logs when I do awslogs get stream. It's not giving any error, It just return nothing.

awslogs groups works correctly showing all groups, but when I use awslogs streams It don't return all streams also.

Is there something I'm missing? I didn't configure anything, just expected It to work with aws cli credentials.

Aws cli returns cloudwatch log without problem, so I don't think It's a permissions problem.

jordisantamaria avatar Apr 21 '21 05:04 jordisantamaria

same problem

xinhuagu avatar May 01 '21 12:05 xinhuagu

Hi @jordisantamaria @xinhuagu

You should to define the log_group_name to search streams in it. It's a positional argument. For example (replace group name):

awslogs streams '/aws/lambda/cdkworkshop-HelloHandler2E4FBA4D-j0QXnaK050Xv'

AntonUspishnyi avatar Jul 01 '21 11:07 AntonUspishnyi

Same issue here , but for Elastic beanstalk that have their logs separated for each instance: >awslogs streams /aws/elasticbeanstalk/MessageStoreApi-qa/var/log/docker-events.log does not return anything.

Adding the instance on the end, throws the error: The specified log group does not exist. : >awslogs streams /aws/elasticbeanstalk/MessageStoreApi-qa/var/log/docker-events.log/i-096bc814d35a469e0

File "c:\users\rsilva\source\elastic_beanstalk_cdk\.venv\lib\site-packages\botocore\client.py", line 386, in _api_call return self._make_api_call(operation_name, kwargs) File "c:\users\rsilva\source\elastic_beanstalk_cdk\.venv\lib\site-packages\botocore\client.py", line 705, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the DescribeLogStreams operation: The specified log group does not exist.

engrogerio avatar Jul 01 '21 18:07 engrogerio

Hi @jordisantamaria @xinhuagu

You should to define the log_group_name to search streams in it. It's a positional argument. For example (replace group name):

awslogs streams '/aws/lambda/cdkworkshop-HelloHandler2E4FBA4D-j0QXnaK050Xv'

I know, thats what I'm doing. Btw with cloudwatch logs generated by cdk It works correctly, but with cloudwatch logs I created with sam cli and cloudformation without cdk... It don't works, It returns nothing, but logs exist and I can watch them with aws cli. スクリーンショット 2021-07-04 0 12 17

jordisantamaria avatar Jul 03 '21 15:07 jordisantamaria

Even if you try plain?

awslogs get "/aws/lambda/test"

Maybe they are too old and you have to set --start argument to try find older ones.

AntonUspishnyi avatar Jul 03 '21 19:07 AntonUspishnyi

Even if you try plain?

awslogs get "/aws/lambda/test"

Maybe they are too old and you have to set --start argument to try find older ones.

I see, putting --start parameter It works, but what is too old for you? streams created today are not being returned without --start parameter.

jordisantamaria avatar Jul 04 '21 07:07 jordisantamaria

Even if you try plain?

awslogs get "/aws/lambda/test"

Maybe they are too old and you have to set --start argument to try find older ones.

I see, putting --start parameter It works, but what is too old for you? streams created today are not being returned without --start parameter.

Hi, sorry, I'm not an author/maintainer of the project, I'm the same user as you 😅 I think it's about smart defaults to prevent querying to many logs.

And I don't think that it's about old/new streams, it's more about new logs entries.

AntonUspishnyi avatar Jul 04 '21 15:07 AntonUspishnyi