allow LOG_STREAM_PREFIX to be empty for aws_logs

This commit is contained in:
Tony Blyler 2022-10-10 23:48:51 -04:00
parent af321981a5
commit 664c0667de
No known key found for this signature in database

View file

@ -51,7 +51,15 @@ aws_logs() {
LOG_STREAM_PREFIX="$(aws logs describe-log-streams --log-group-name "$LOG_GROUP" | jq -r '.logStreams | .[] | .logStreamName' | fzf -1 --print-query | head -n 1)"
fi
aws logs tail "${LOG_GROUP}" --log-stream-name-prefix "$LOG_STREAM_PREFIX" "$@"
if [ -n "$LOG_STREAM_PREFIX" ]; then
aws logs tail "${LOG_GROUP}" \
--log-stream-name-prefix "$LOG_STREAM_PREFIX" \
"$@"
exit $?
fi
aws logs tail "${LOG_GROUP}" "$@"
)
}