Sum size of binlog for a specific day
ls -lha binlog* | grep "Oct 20" | awk '{print $5}' | numfmt --from=iec | awk '{ sum += $1; } END { print sum; }' | numfmt --to=iec
Convert it to readable text file
mysqlbinlog -vv --base64-output=decode-rows binlog.190611 > binlog.190611.txt
Count occurences of database modifications
New approach (better performances)
rg -i --no-line-number '^[^*].*(update|insert|delete|replace|alter)' to_analyze.txt > statements_index.txt
cat statements_index.txt | tr '[A-Z]' '[a-z]' | sort | uniq -c | sort -rn > excel.txt
Slow approach
cat binlog.190611.txt |grep -i 'update\|insert\|delete\|replace\|alter' | tr ‘[A-Z]’ ‘[a-z]’|sed -e '/*/d' | sort | uniq -c | sort -n