I'm trying to get log events via my aws server. I log into the server as usual, and then I enter the following command:
sudo aws logs get-log-events --log-group-name <myLogs> --log-stream-name <stream-name>
I get the error...
You must specify a region. You can also configure your region by running "aws configure".
So, I enter aws configure
and I see the following:
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]:
Default output format [None]:
So, I go to my IAM page, and click on Users
, following this instructions. And after I create the key, I get each of the four pieces of information from the following sources:
Access Key ID
from the IAM page.
Secret Access Key
after creating the key on the IAM page.
The IAM page shows N/A
for the fields region name
and output format
, so I am not sure where to get the region name
and the default format
. So I entered the following:
region name
= us-west-2
output format
= json
Trying again, I enter
sudo aws logs get-log-events --log-group-name <myLogs> --log-stream-name <sream-name --region us-west-2
..but I get the same error message again: You must specify a region. You can also configure your region by running aws configure
.
How do I find the correct region name
and output format
? More generally, how do I get my aws
credentials or configurations to stop giving me errors?