Last active
April 9, 2019 02:36
-
-
Save amazingandyyy/55a48fa82777d6887803eee74a1ed490 to your computer and use it in GitHub Desktop.
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
# https://stackoverflow.com/questions/41573277/extract-count-of-a-string-in-log-file-using-grep | |
while sleep 1; do | |
attemps=$(grep -A 2 "KAFKA_CLIENT_PRODUCER_ATTEMPT" /srv/minted/logs/www-wsgi.log | grep -c "KAFKA_CLIENT_PRODUCER_ATTEMPT") | |
sent=$(grep -A 2 "KAFKA_CLIENT_PRODUCER_GOOD" /srv/minted/logs/www-wsgi.log | grep -c "KAFKA_CLIENT_PRODUCER_GOOD") | |
fail=$(grep -A 2 "KAFKA_CLIENT_PRODUCER_BAD" /srv/minted/logs/www-wsgi.log | grep -c "KAFKA_CLIENT_PRODUCER_BAD") | |
echo $sent / $attemps | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the result looks like this: