Enhance dovecot-logreport script: improve statistics output format and clarity
This commit is contained in:
+16
-2
@@ -599,10 +599,10 @@ BEGIN {
|
|||||||
if (emailneedle != "" && index(tolower(user), emailneedle) == 0) next
|
if (emailneedle != "" && index(tolower(user), emailneedle) == 0) next
|
||||||
|
|
||||||
total++
|
total++
|
||||||
|
c_res[res]++
|
||||||
|
|
||||||
# Stats sammeln
|
# Stats sammeln
|
||||||
if (stats == 1) {
|
if (stats == 1) {
|
||||||
c_res[res]++
|
|
||||||
c_type[type]++
|
c_type[type]++
|
||||||
c_res_type[res "@" type]++
|
c_res_type[res "@" type]++
|
||||||
|
|
||||||
@@ -642,7 +642,21 @@ BEGIN {
|
|||||||
|
|
||||||
END {
|
END {
|
||||||
progress_clear()
|
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 "Events: " total
|
||||||
print ""
|
print ""
|
||||||
|
|||||||
Reference in New Issue
Block a user