Skip to content

Instantly share code, notes, and snippets.

@PierreTurnbull
Created October 6, 2020 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PierreTurnbull/b63557ee5817d3836fe23605dce56b71 to your computer and use it in GitHub Desktop.
Save PierreTurnbull/b63557ee5817d3836fe23605dce56b71 to your computer and use it in GitHub Desktop.
# display filtered logs from a Docker container
function dcl () {
# display logs
docker logs $(docker ps | grep $1 | head -c 12) |
# filter by keyword (ex: clientId)
if [ -z "$2" ]
then
cat
else
cat | grep "$2"
fi;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment