Created
July 7, 2017 06:45
-
-
Save ausuwardi/7dfe9655ca5f4bd516e8d44a4778ebb7 to your computer and use it in GitHub Desktop.
Count 'concurrent update' error in postgresql, sum per hour
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
zcat /var/log/postgresql/postgresql-9.6-main.log.3.gz | grep 'due to concurrent update' | awk 'BEGIN {time="--"; count=0} {x=substr($2,1,2); if (time !=x) {printf "%s,%d\n", time, count; time=x; count=0;} count=count+1;} END {printf "%s,%d\n", time, count}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment