Enhance dovecot-logreport script: improve statistics output format and clarity

This commit is contained in:
2026-07-07 23:21:49 +02:00
parent 92bae4df99
commit 1ac6344d29
+16 -2
View File
@@ -599,10 +599,10 @@ BEGIN {
if (emailneedle != "" && index(tolower(user), emailneedle) == 0) next
total++
c_res[res]++
# Stats sammeln
if (stats == 1) {
c_res[res]++
c_type[type]++
c_res_type[res "@" type]++
@@ -642,7 +642,21 @@ BEGIN {
END {
progress_clear()
if (stats != 1) exit
if (stats != 1) {
if (oneline == 1) {
printf "stats\ttotal=%d\tsuccess=%d\tfail=%d\terror=%d\tinfo=%d\n", total+0, c_res["success"]+0, c_res["fail"]+0, c_res["error"]+0, c_res["info"]+0
exit
}
print ""
print "Statistics:"
printf " total: %7d\n", total+0
printf " success: %7d\n", c_res["success"]+0
printf " fail: %7d\n", c_res["fail"]+0
printf " error: %7d\n", c_res["error"]+0
printf " info: %7d\n", c_res["info"]+0
exit
}
print "Events: " total
print ""