Note: replace {{server}} with your domain or ip
- Login as the ec2-user
ssh -i key.pem ec2-user@{{server}}
- Switch to administrator
sudo -i
# this script queries aws logs with insights filtering on ERROR | |
# explanation of start and end times | |
#--start-time = unix timestamp 30 mins in the past | |
#--end-time = unix timestamp now | |
QUERY_ID=$(aws logs start-query \ | |
--profile $profile \ | |
--log-group-name /aws/lambda/aap-event-consumer-dev \ | |
--start-time `date -v-30M "+%s"` \ |
Note: replace {{server}} with your domain or ip
ssh -i key.pem ec2-user@{{server}}
sudo -i