Skip to content

Instantly share code, notes, and snippets.

@mchurichi
Created May 19, 2018 00:59
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 mchurichi/08b0be8c610ed154732c1402a0804c31 to your computer and use it in GitHub Desktop.
Save mchurichi/08b0be8c610ed154732c1402a0804c31 to your computer and use it in GitHub Desktop.
Script to see k8s logs using kubectl and multitail
#!/bin/bash
REGEX='s/('$1'*-[a-z0-9\-]*)(.*)/\1/g'
POD=`kubectl get pods | grep $1 | sed -E $REGEX`
multitail -f --config $HOME/multitail.conf -CS $1 -l 'kubectl logs '$POD' -f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment