You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like to always get the latest events from a certain log stream - like AWS CloudWatch console does it. If nothing recent has been published to a certain log - I would still want the latest n items to show up.
Describe the solution you'd like
If I tail a log with cw and there hasn't been a lot of traffic in that stream recently nothing will show. I could give it a --start parameter but I don't know what that start parameter should be. Some of logs are really high volume and some are almost empty.
By using aws logs get-log-events I get a timestamp of the latest log item, that could be used a indication of the start param.
Describe alternatives you've considered
I've been thinking of wrapping cw in a shell script that does this but I think this functionality would be better implemented in the util itself.
Additional context
I have a nice fuzzy finder logs setup that is almost complete - I just need this feature to ditch the AWS logs console altogether
:
declare -A log_streams
function refresh_log_streams_list {
log_streams=()
}
function logs {
# Mashup of https://github.com/lucagrulla/cw and https://github.com/junegunn/fzf
# Also uses unbuffer avaiable on mac via brew install expect
# Allows you to access logs quickly
env=$1
query=$2
if [[ -z ${log_streams["$env"]} ]] ; then
echo "refreshing $env log_stream_list"
log_streams["$env"]=$(cw ls streams pilot-$env)
fi
echo "$log_streams["$env"]" | fzf --ansi --preview-window "right,80%" --info inline --border -q "$query" --preview-window follow --preview "unbuffer cw tail -tf pilot-$env:{}" | xargs -I '{}' cw tail -tf pilot-$env:{}
}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I would like to always get the latest events from a certain log stream - like AWS CloudWatch console does it. If nothing recent has been published to a certain log - I would still want the latest n items to show up.
Describe the solution you'd like
If I tail a log with cw and there hasn't been a lot of traffic in that stream recently nothing will show. I could give it a --start parameter but I don't know what that start parameter should be. Some of logs are really high volume and some are almost empty.
By using aws logs get-log-events I get a timestamp of the latest log item, that could be used a indication of the start param.
Describe alternatives you've considered
I've been thinking of wrapping cw in a shell script that does this but I think this functionality would be better implemented in the util itself.
Additional context
I have a nice fuzzy finder logs setup that is almost complete - I just need this feature to ditch the AWS logs console altogether
:
The text was updated successfully, but these errors were encountered: