I can view the log using the following command.
aws logs get-log-events --log-group-name groupName --log-stream-name streamName --limit 100
wha
Note that tailing an aws log is now a supported feature of the official awscli, albeit only in awscli v2, which is not released yet. Tailing and following the logs (like tail -f
) can now be accomplished by something like:
aws logs tail $group_name --follow
To install the v2 version, see the instructions on this page. It was implemented in this PR. To see it demonstrated at the last re:Invent conference, see this video.
In addition to tailing the logs, it allows viewing the logs back to a specified time using the --since
parameter, which can take an absolute or relative time
aws logs tail $group_name --since 5d
To keep the v1 and v2 versions of awscli separate, I installed awscli v2 into a separate python virtual environment and activate it only when I need to use awscli v2.