Accept '/' and '.' characters within the service name
authorarjen <arjen>
Tue, 13 Jan 2004 12:20:12 +0000 (12:20 +0000)
committerarjen <arjen>
Tue, 13 Jan 2004 12:20:12 +0000 (12:20 +0000)
src/gcm_input/irix_syslog_cooker.cpp
src/gcm_input/syslog_cooker.cpp

index 19a69e3..d99d9e6 100644 (file)
@@ -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
 **
 
 /*****************************
    $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
 
 *****************************/
 
-/* 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 <ctype.h>
 
 #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;
index 30ed2d0..5e20732 100644 (file)
@@ -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
 **
 
 /*****************************
    $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
 
 *****************************/
 
-/* 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 <ctype.h>
 
 #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;