Created
April 27, 2025 14:58
-
-
Save parsibox/5ccc1d0ee79598f10db7f68bc29e9b79 to your computer and use it in GitHub Desktop.
calculate rate of new lines in log
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
stdbuf -oL tail -f /var/www/golang/logs/2025-04-27/esb_worker_db_queue_peertopeer_0_404012_2_access.log | \ | |
> stdbuf -oL grep -oP '"time":"\K[^"]+' | \ | |
> stdbuf -oL awk -F'[:T.]' '{print $2":"$3}' | \ | |
> stdbuf -oL uniq -c | \ | |
> while read count minute; do | |
> echo "Rate for $minute: $count logs"; | |
> done |
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
stdbuf -oL tail -f /var/www/golang/logs/2025-04-27/esb_worker_db_queue_peertopeer_0_404012_2_access.log | \ | |
> stdbuf -oL grep -oP '"time":"\K[^"]+' | \ | |
> stdbuf -oL awk -F'[T.]' '{print $2}' | \ | |
> stdbuf -oL uniq -c | \ | |
> while read count second; do | |
> echo "Rate for $second: $count logs"; | |
> done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment