Created
May 12, 2017 19:55
-
-
Save portante/d118053db7bc385a0d0e86e47578ed74 to your computer and use it in GitHub Desktop.
Simple bash script to get the logs of all the logging component pods with timestamps
This file contains hidden or 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
| #!/bin/bash | |
| function fetchlogs { | |
| if [ $1 = "kibana" ]; then | |
| _container="-c kibana" | |
| else | |
| _container="" | |
| fi | |
| for i in $(oc get pods --output=name -l component=$1 | sed 's|pod/||') ; do oc logs $i $_container > $i.$2.log ; done | |
| } | |
| _TS=$(date +"%Y%m%d%H%M%S") | |
| for j in es kibana curator fluentd ; do | |
| fetchlogs $j $_TS | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment