From: Willy Tarreau Date: Sun, 12 Sep 2010 15:56:16 +0000 (+0200) Subject: [MINOR] halog: add '-tc' to sort by termination codes X-Git-Tag: v1.5-dev8~467 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8fc1103a51eb8d8631cafaad1a8cdcc5454dbbd;p=thirdparty%2Fhaproxy.git [MINOR] halog: add '-tc' to sort by termination codes This output lists all encountered termination codes by number of occurrences. --- diff --git a/contrib/halog/halog.c b/contrib/halog/halog.c index b9da76155a..ebdcfcfc4e 100644 --- a/contrib/halog/halog.c +++ b/contrib/halog/halog.c @@ -1,5 +1,5 @@ /* - * haproxy log time reporter + * haproxy log statistics reporter * * Copyright 2000-2010 Willy Tarreau * @@ -10,14 +10,6 @@ * */ -/* - * gcc -O2 -o halog2 halog2.c -Iinclude src/ebtree.c src/eb32tree.c fgets2.c - * - * Usage: - * $0 [ min_delay [ min_count [ field_shift ]]] < haproxy.log - * Note: if min_delay < 0, it only outputs lines with status codes 5xx. - */ - #include #include #include @@ -35,6 +27,7 @@ #define SERVER_FIELD 8 #define TIME_FIELD 9 #define STATUS_FIELD 10 +#define TERM_CODES_FIELD 14 #define CONN_FIELD 15 #define MAXLINE 16384 #define QBITS 4 @@ -75,6 +68,7 @@ struct srv_st { #define FILT_COUNT_STATUS 0x800 #define FILT_COUNT_SRV_STATUS 0x1000 +#define FILT_COUNT_TERM_CODES 0x2000 unsigned int filter = 0; unsigned int filter_invert = 0; @@ -86,7 +80,7 @@ void die(const char *msg) { fprintf(stderr, "%s" - "Usage: halog [-q] [-c] [-v] [-gt] [-pct] [-st] [-srv] [-s ] [-e|-E] [-rt|-RT