1 --- ccze-0.2.1.orig/ccze.plugins
2 +++ ccze-0.2.1/ccze.plugins
10 --- ccze-0.2.1.orig/doc/ccze.1.in
11 +++ ccze-0.2.1/doc/ccze.1.in
14 If \fIcssfile\fR is set, then CCZE will not inline the Cascading Style
15 Sheet information into the outputted HTML, but include a link to the
16 -external stylesheet given in this paramater.
17 +external stylesheet given in this parameter.
19 .B \-p, \-\-plugin \fIPLUGIN\fR
20 While the default action is to load all plugins (see the \fBPlugins\fR
22 plugins will be loaded. If one knows what kind of log will be piped
23 through \fBccze\fR, using this option may result in a slight speedup.
25 -.B \-r, \-\-remove\-facilty
26 +.B \-r, \-\-remove\-facility
27 Syslog\-ng puts the facility level before log messages. With this
28 switch, these can be cut off.
30 --- ccze-0.2.1.orig/src/ccze-color.c
31 +++ ccze-0.2.1/src/ccze-color.c
33 {CCZE_KEYWORD ("system", CCZE_COLOR_SYSTEMWORD, "\"System words\"")},
34 {CCZE_KEYWORD ("process", CCZE_COLOR_PROC, "Sender process")},
35 {CCZE_KEYWORD ("dir", CCZE_COLOR_DIR, "Directory names")},
36 + {CCZE_KEYWORD ("file", CCZE_COLOR_FILE, "File names")},
37 {CCZE_KEYWORD ("prot", CCZE_COLOR_PROT, "Protocols")},
38 {CCZE_KEYWORD ("service", CCZE_COLOR_SERVICE, "Services")},
39 {CCZE_KEYWORD ("email", CCZE_COLOR_EMAIL, "E-mail addresses")},
41 {CCZE_KEYWORD ("ftpcodes", CCZE_COLOR_FTPCODES, "FTP codes")},
42 {CCZE_KEYWORD ("keyword", CCZE_COLOR_KEYWORD,
43 "Various keywords (like PHP in php.log, etc)")},
44 + {CCZE_KEYWORD ("pkgstatus", CCZE_COLOR_PKGSTATUS, "package status (dpkg)")},
45 + {CCZE_KEYWORD ("pkg", CCZE_COLOR_PKG, "package name (dpkg)")},
47 {CCZE_KEYWORD_H ("black", CCZE_COLOR_STATIC_BLACK, "Black")},
48 {CCZE_KEYWORD_H ("red", CCZE_COLOR_STATIC_RED, "Red")},
50 ccze_color_table[CCZE_COLOR_EMAIL] = (RAW_ANSI_BOLD | RAW_ANSI_GREEN);
51 ccze_color_table[CCZE_COLOR_SUBJECT] = (RAW_ANSI_MAGENTA);
52 ccze_color_table[CCZE_COLOR_DIR] = (RAW_ANSI_BOLD | RAW_ANSI_CYAN);
53 + ccze_color_table[CCZE_COLOR_FILE] = ccze_color_table[CCZE_COLOR_DIR];
54 ccze_color_table[CCZE_COLOR_SIZE] = (RAW_ANSI_BOLD | RAW_ANSI_WHITE);
55 ccze_color_table[CCZE_COLOR_USER] = (RAW_ANSI_BOLD | RAW_ANSI_YELLOW);
56 ccze_color_table[CCZE_COLOR_HTTPCODES] = (RAW_ANSI_BOLD | RAW_ANSI_WHITE);
58 ccze_color_table[CCZE_COLOR_PERCENTAGE] = (RAW_ANSI_BOLD | RAW_ANSI_YELLOW);
59 ccze_color_table[CCZE_COLOR_FTPCODES] = (RAW_ANSI_CYAN);
60 ccze_color_table[CCZE_COLOR_KEYWORD] = (RAW_ANSI_BOLD | RAW_ANSI_YELLOW);
61 + ccze_color_table[CCZE_COLOR_PKGSTATUS] = (RAW_ANSI_GREEN);
62 + ccze_color_table[CCZE_COLOR_PKG] = (RAW_ANSI_BOLD|RAW_ANSI_RED);
64 ccze_color_table[CCZE_COLOR_STATIC_BLACK] = (RAW_ANSI_BLACK);
65 ccze_color_table[CCZE_COLOR_STATIC_RED] = (RAW_ANSI_RED);
67 ccze_color_table[CCZE_COLOR_EMAIL] = (BOLD GREEN);
68 ccze_color_table[CCZE_COLOR_SUBJECT] = (MAGENTA);
69 ccze_color_table[CCZE_COLOR_DIR] = (BOLD CYAN);
70 + ccze_color_table[CCZE_COLOR_FILE] = ccze_color_table[CCZE_COLOR_DIR];
71 ccze_color_table[CCZE_COLOR_SIZE] = (BOLD WHITE);
72 ccze_color_table[CCZE_COLOR_USER] = (BOLD YELLOW);
73 ccze_color_table[CCZE_COLOR_HTTPCODES] = (BOLD WHITE);
75 ccze_color_table[CCZE_COLOR_PERCENTAGE] = (BOLD YELLOW);
76 ccze_color_table[CCZE_COLOR_FTPCODES] = (CYAN);
77 ccze_color_table[CCZE_COLOR_KEYWORD] = (BOLD YELLOW);
78 + ccze_color_table[CCZE_COLOR_PKGSTATUS] = (GREEN);
79 + ccze_color_table[CCZE_COLOR_PKG] = (BOLD RED);
81 ccze_color_table[CCZE_COLOR_STATIC_BLACK] = (BLACK);
82 ccze_color_table[CCZE_COLOR_STATIC_RED] = (RED);
83 --- ccze-0.2.1.orig/src/ccze-wordcolor.c
84 +++ ccze-0.2.1/src/ccze-wordcolor.c
86 "warn", "restart", "exit", "stop", "end", "shutting", "down", "close",
87 "unreach", "can't", "cannot", "skip", "deny", "disable", "ignored",
88 "miss", "oops", "not", "backdoor", "blocking", "ignoring",
89 - "unable", "readonly", "offline", "terminate", "empty"
90 + "unable", "readonly", "offline", "terminate", "empty", "virus"
93 static char *words_good[] = {
94 "activ", "start", "ready", "online", "load", "ok", "register", "detected",
95 "configured", "enable", "listen", "open", "complete", "attempt", "done",
96 - "check", "listen", "connect", "finish"
97 + "check", "listen", "connect", "finish", "clean"
100 static char *words_error[] = {
102 reg_time = pcre_compile ("\\d{1,2}:\\d{1,2}(:\\d{1,2})?", 0, &error,
104 reg_addr = pcre_compile ("^0x(\\d|[a-f])+$", 0, &error, &errptr, NULL);
105 - reg_num = pcre_compile ("^-?\\d+$", 0, &error, &errptr, NULL);
106 + reg_num = pcre_compile ("^[+-]?\\d+$", 0, &error, &errptr, NULL);
107 reg_sig = pcre_compile ("^sig(hup|int|quit|ill|abrt|fpe|kill|segv|pipe|"
108 "alrm|term|usr1|usr2|chld|cont|stop|tstp|tin|tout|"
109 "bus|poll|prof|sys|trap|urg|vtalrm|xcpu|xfsz|iot|"
110 --- ccze-0.2.1.orig/src/mod_syslog.c
111 +++ ccze-0.2.1/src/mod_syslog.c
115 reg_syslog = pcre_compile ("^(\\S*\\s{1,2}\\d{1,2}\\s\\d\\d:\\d\\d:\\d\\d)"
116 - "\\s(\\S+)\\s((\\S+:?)\\s(.*))$", 0, &error,
117 + "\\s(\\S+)\\s+((\\S+:?)\\s(.*))$", 0, &error,
119 hints_syslog = pcre_study (reg_syslog, 0, &error);
121 --- ccze-0.2.1.orig/src/ccze.h
122 +++ ccze-0.2.1/src/ccze.h
130 CCZE_COLOR_HTTPCODES,
132 CCZE_COLOR_PERCENTAGE,
135 + CCZE_COLOR_PKGSTATUS,
138 CCZE_COLOR_STATIC_BLACK,
139 CCZE_COLOR_STATIC_RED,
140 --- ccze-0.2.1.orig/src/mod_dpkg.c
141 +++ ccze-0.2.1/src/mod_dpkg.c
143 +/* -*- mode: c; c-file-style: "gnu" -*-
144 + * mod_dpkg.c -- Dpkg log-coloriser module for CCZE
145 + * Copyright (C) 2007 arno. <arno.@no-log.org>
147 + * This file is part of ccze.
149 + * ccze is free software; you can redistribute it and/or modify it
150 + * under the terms of the GNU General Public License as published by
151 + * the Free Software Foundation; either version 2 of the License, or
152 + * (at your option) any later version.
154 + * ccze is distributed in the hope that it will be useful, but WITHOUT
155 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
156 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
157 + * License for more details.
159 + * You should have received a copy of the GNU General Public License
160 + * along with this program; if not, write to the Free Software
161 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
168 +static void ccze_dpkg_setup (void);
169 +static void ccze_dpkg_shutdown (void);
170 +static int ccze_dpkg_handle (const char *str, size_t length, char **rest);
173 +static pcre *reg_dpkg_status, *reg_dpkg_action, *reg_dpkg_conffile;
176 +ccze_dpkg_status_process(const char *str, int *offsets, int match)
178 + char *date, *state, *pkg, *installed_version;
180 + pcre_get_substring (str, offsets, match, 1, (const char **)&date);
181 + pcre_get_substring (str, offsets, match, 2, (const char **)&state);
182 + pcre_get_substring (str, offsets, match, 3, (const char **)&pkg);
183 + pcre_get_substring (str, offsets, match, 4, (const char **)&installed_version);
185 + ccze_print_date(date);
187 + ccze_addstr(CCZE_COLOR_KEYWORD, "status");
189 + ccze_addstr(CCZE_COLOR_PKGSTATUS, state);
191 + ccze_addstr(CCZE_COLOR_PKG, pkg);
193 + ccze_addstr(CCZE_COLOR_DEFAULT, installed_version);
199 + free(installed_version);
205 +ccze_dpkg_action_process(const char *str, int *offsets, int match)
207 + char *date, *action, *pkg, *installed_version, *available_version;
209 + pcre_get_substring (str, offsets, match, 1, (const char **)&date);
210 + pcre_get_substring (str, offsets, match, 2, (const char **)&action);
211 + pcre_get_substring (str, offsets, match, 3, (const char **)&pkg);
212 + pcre_get_substring (str, offsets, match, 4, (const char **)&installed_version);
213 + pcre_get_substring (str, offsets, match, 5, (const char **)&available_version);
215 + ccze_print_date(date);
217 + ccze_addstr(CCZE_COLOR_KEYWORD, action);
219 + ccze_addstr(CCZE_COLOR_PKG, pkg);
221 + ccze_addstr(CCZE_COLOR_DEFAULT, installed_version);
223 + ccze_addstr(CCZE_COLOR_DEFAULT, available_version);
229 + free(installed_version);
230 + free(available_version);
236 +ccze_dpkg_conffile_process(const char *str, int *offsets, int match)
238 + char *date, *filename, *decision;
239 + /* YYYY-MM-DD HH:MM:SS conffile <filename> <decision> */
241 + pcre_get_substring (str, offsets, match, 1, (const char **)&date);
242 + pcre_get_substring (str, offsets, match, 2, (const char **)&filename);
243 + pcre_get_substring (str, offsets, match, 3, (const char **)&decision);
245 + ccze_print_date(date);
247 + ccze_addstr(CCZE_COLOR_KEYWORD, "conffile");
249 + ccze_addstr(CCZE_COLOR_FILE, filename);
251 + ccze_addstr(CCZE_COLOR_KEYWORD, decision);
263 +ccze_dpkg_setup (void)
268 + /* YYYY-MM-DD HH:MM:SS status <state> <pkg> <installed-version> */
269 + reg_dpkg_status = pcre_compile(
270 + "^([-\\d]{10}\\s[:\\d]{8})\\sstatus\\s(\\S+)\\s(\\S+)\\s(\\S+)$",
271 + 0, &error, &errptr, NULL);
273 + /* YYYY-MM-DD HH:MM:SS <action> <pkg> <installed-version> <available-version> */
274 + reg_dpkg_action = pcre_compile(
275 + "^([-\\d]{10}\\s[:\\d]{8})\\s(install|upgrade|remove|purge)\\s(\\S+)\\s(\\S+)\\s(\\S+)$",
276 + 0, &error, &errptr, NULL);
278 + /* YYYY-MM-DD HH:MM:SS conffile <filename> <decision> */
279 + reg_dpkg_conffile = pcre_compile(
280 + "^([-\\d]{10}\\s[:\\d]{8})\\sconffile\\s(\\S+)\\s(install|keep)$",
281 + 0, &error, &errptr, NULL);
286 +ccze_dpkg_shutdown (void)
288 + free (reg_dpkg_status);
289 + free (reg_dpkg_action);
290 + free (reg_dpkg_conffile);
294 +ccze_dpkg_handle (const char *str, size_t length, char **rest)
296 + int match, offsets[99];
298 + if ((match = pcre_exec (reg_dpkg_status, NULL, str, length,
299 + 0, 0, offsets, 99)) >= 0)
301 + *rest = ccze_dpkg_status_process (str, offsets, match);
305 + if ((match = pcre_exec (reg_dpkg_action, NULL, str, length,
306 + 0, 0, offsets, 99)) >= 0)
308 + *rest = ccze_dpkg_action_process (str, offsets, match);
312 + if ((match = pcre_exec (reg_dpkg_conffile, NULL, str, length,
313 + 0, 0, offsets, 99)) >= 0)
315 + *rest = ccze_dpkg_conffile_process (str, offsets, match);
322 +CCZE_DEFINE_PLUGIN (dpkg, FULL, "Coloriser for dpkg logs.");