Created
November 9, 2022 10:29
-
-
Save vilasmaciel/add293657c9dd35bfff22e3266852384 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cwtail() { | |
time="" | |
filter="" | |
if ! [ -z $1 ] && ! [ -z $2 ] ; | |
then | |
filter=$1 | |
time=$2 | |
fi | |
if ! [ -z $1 ] && [ -z $2 ] && [[ $1 =~ ^-b ]]; | |
then | |
time=$1 | |
else | |
filter=$1 | |
fi | |
if [ -z $filter ]; | |
then | |
selected=( $(cw ls groups | fzf --height 60% --reverse) ) | |
else | |
selected=( $(cw ls groups | grep $filter | fzf --height 60% --reverse) ) | |
fi | |
if ! [ -z $selected ]; | |
then | |
echo "cw tail -ft $selected $time" | |
cw tail -ft $selected $time | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Too for consuming CloudWatch logs.
Dependencies:
brew install fzf
brew tap lucagrulla/tap & brew install cw
Installation:
.zshrc
or similarUsage: