TylerBrock / saw

Fast, multi-purpose tool for AWS CloudWatch Logs
MIT License
1.4k stars 77 forks source link

"Error ThrottlingException: Rate exceeded" #33

Open macktab opened 5 years ago

macktab commented 5 years ago

Getting "Error ThrottlingException: Rate exceeded status code: 400, request id: a7d9be90-627d-11e9-9a51-578e1f84b418" from saw. Maybe, can add some refresh interval for parameter?

sk33wiff commented 4 years ago

In the meanwhile, it's possible to implement a retry with the following script:

(knife is just my custom wrapper for sed)

#!/bin/bash

LOG=$1
CUT="${2:-\[[^]]+\] \([^)]+\)}"
RETRIES="${3:-1}"

# set a bash option so that if any of the piped commands fails, $? will be different than 0
set -o pipefail
# watch logs and trim part of the output
saw watch "$LOG" | knife "$CUT"
# if the pipe fails and retries are within a reasonable number, retry
if [[ $? -ne 0 ]] && (("$RETRIES" <= 10)) ; then
    sleep 1
    RETRIES=$((RETRIES + 1))    
    echo -en "\nRetrying... $0 \"$LOG\" \"$CUT\" $RETRIES\n"
    $0 "$LOG" "$CUT" $RETRIES
fi
red61wjt commented 2 years ago

Any update? I'm seeing this issue and it's really hampering my use of the tool