From: arjen Date: Tue, 13 Jan 2004 12:20:12 +0000 (+0000) Subject: Accept '/' and '.' characters within the service name X-Git-Tag: V_0_0_10~31 X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=f5dbf94b487e9d37e280e695817229ae9db8377a Accept '/' and '.' characters within the service name --- diff --git a/src/gcm_input/irix_syslog_cooker.cpp b/src/gcm_input/irix_syslog_cooker.cpp index 19a69e3..d99d9e6 100644 --- a/src/gcm_input/irix_syslog_cooker.cpp +++ b/src/gcm_input/irix_syslog_cooker.cpp @@ -8,7 +8,7 @@ *********************** ** FILE NAME : irix_syslog_cooker.cpp ** SYSTEM NAME : -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Cooks IRIX system log lines ** @@ -26,7 +26,10 @@ /***************************** $Log: irix_syslog_cooker.cpp,v $ - Revision 1.1 2003-08-11 16:56:16 arjen + Revision 1.2 2004-01-13 12:20:13 arjen + Accept '/' and '.' characters within the service name + + Revision 1.1 2003/08/11 16:56:16 arjen Different kinds of log files are parsed by a collection of objects of different classes, derived from the base class line_cooker Depending on the message content or the message_type element in @@ -38,14 +41,14 @@ *****************************/ -/* static const char *RCSID = "$Id: irix_syslog_cooker.cpp,v 1.1 2003-08-11 16:56:16 arjen Exp $"; */ +/* static const char *RCSID = "$Id: irix_syslog_cooker.cpp,v 1.2 2004-01-13 12:20:13 arjen Exp $"; */ #include #include "irix_syslog_cooker.h" static const String syslog_date_re("[[:alpha:]]{3} [ 123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}"); -static const regex re_syslog_irix(syslog_date_re + " [0-7][A-T]:[[:alnum:]]+ [[:alpha:]]+.*:.+"); +static const regex re_syslog_irix(syslog_date_re + " [0-7][A-T]:[[:alnum:]]+ [[:alpha:]/]+.*:.+"); bool irix_syslog_cooker::check_pattern(String logline) { @@ -86,7 +89,7 @@ bool irix_syslog_cooker::cook_this(String logline, UTC arrival) // Extract the service rest <<= i + 1; - for (i = 0; isalpha(rest[i]) && i < ~rest; i++); + for (i = 0; (isalpha(rest[i]) || rest[i] == '/' || rest[i] == '.') && i < ~rest; i++); srv = rest(0, i); return true; diff --git a/src/gcm_input/syslog_cooker.cpp b/src/gcm_input/syslog_cooker.cpp index 30ed2d0..5e20732 100644 --- a/src/gcm_input/syslog_cooker.cpp +++ b/src/gcm_input/syslog_cooker.cpp @@ -8,7 +8,7 @@ *********************** ** FILE NAME : syslog_cooker.cpp ** SYSTEM NAME : -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Cooks system log lines ** @@ -26,7 +26,10 @@ /***************************** $Log: syslog_cooker.cpp,v $ - Revision 1.1 2003-08-11 16:56:16 arjen + Revision 1.2 2004-01-13 12:20:12 arjen + Accept '/' and '.' characters within the service name + + Revision 1.1 2003/08/11 16:56:16 arjen Different kinds of log files are parsed by a collection of objects of different classes, derived from the base class line_cooker Depending on the message content or the message_type element in @@ -38,14 +41,14 @@ *****************************/ -/* static const char *RCSID = "$Id: syslog_cooker.cpp,v 1.1 2003-08-11 16:56:16 arjen Exp $"; */ +/* static const char *RCSID = "$Id: syslog_cooker.cpp,v 1.2 2004-01-13 12:20:12 arjen Exp $"; */ #include #include "syslog_cooker.h" static const String syslog_date_re("[[:alpha:]]{3} [ 123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}"); -static const regex re_syslog(syslog_date_re + " [[:alnum:]]+ [[:alpha:]]+.*:.+"); +static const regex re_syslog(syslog_date_re + " [[:alnum:]]+ [[:alpha:]/]+.*:.+"); bool syslog_cooker::check_pattern(String logline) { @@ -86,7 +89,7 @@ bool syslog_cooker::cook_this(String logline, UTC arrival) // Extract the service rest <<= i + 1; - for (i = 0; isalpha(rest[i]) && i < ~rest; i++); + for (i = 0; (isalpha(rest[i]) || rest[i] == '/' || rest[i] == '.') && i < ~rest; i++); srv = rest(0, i); return true;