Created
November 7, 2019 17:24
-
-
Save bentito/bbb0f9eb08a3a53a94f01707d4c71d0d 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
#!/bin/bash | |
# usage cmd_name <search_term> [<number of chars before & after for context>] | |
# NOTE: wired to metering-operator specifically | |
search_term=$1 | |
context_amt=${2:-50} | |
echo "search term: $search_term" | |
echo "context of chars before & after: $context_amt" | |
docker exec -i metering-operator bash -c 'tail -n +1 -f /tmp/ansible-operator/runner/metering.openshift.io/v1/MeteringConfig/*/*/artifacts/*/stdout' | grep --line-buffered --only-matching --extended-regexp ".{0,${context_amt}}${search_term}.{0,${context_amt}}"|grep --line-buffered --color --extended-regexp "${search_term}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment