***********************
** FILE NAME : message.cpp
** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
-** VERSION NUMBER : $Revision: 1.12 $
+** VERSION NUMBER : $Revision: 1.13 $
**
** DESCRIPTION : Implementation of the message handling classes
**
/*****************************
$Log: message.cpp,v $
- Revision 1.12 2003-08-11 16:56:16 arjen
+ Revision 1.13 2003-08-16 15:28:45 arjen
+ Fixed a namespace problem
+
+ Revision 1.12 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: message.cpp,v 1.12 2003-08-11 16:56:16 arjen Exp $";
+static const char *RCSID = "$Id: message.cpp,v 1.13 2003-08-16 15:28:45 arjen Exp $";
#include <algorithm>
#include <libxml/xpath.h>
certainty = 0.0;
}
-static const String syslog_date_re("[[:alpha:]]{3} [ 123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}");
static const String mail_date_re("[[:alpha:]]{3}, [ 123]?[0-9] [[:alpha:]]{3} [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} [+-][0-9]{4}");
static const String unix_date_re("[[:alpha:]]{3} [[:alpha:]]{3} [ 123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2} [0-9]{4}");
-static const String email_address_re("[[:alnum:]_.-]+@[[:alnum:]_.-]+");
-static const regex re_syslog(syslog_date_re + " [[:alnum:]]+ [[:alpha:]]+.*:.+");
-static const regex re_syslog_irix(syslog_date_re + " [0-7][A-T]:[[:alnum:]]+ [[:alpha:]]+.*:.+");
static const regex re_PGP("-----BEGIN PGP MESSAGE-----");
static const regex re_dump("^ *DUMP: Date of this level");
-static const regex re_accesslog("(GET|POST) .+ HTTP");
-static const regex re_errorlog("^\\[" + unix_date_re + "\\] \\[(error|notice)\\] .+");
static const regex re_rpm("[[:alnum:]+-]+-[0-9][[:alnum:].-]");
static const regex re_uxmail_from("^From [^ \t]+[ ]+" + unix_date_re);
#ifdef DEBUG
std::cout << "Looking for a line cooker for " << item->content << "\n";
#endif
- list<line_cooker *>::iterator lci = kitchen.begin();
+ std::list<line_cooker *>::iterator lci = kitchen.begin();
pan = 0;
while (pan == 0 && lci != kitchen.end())
{
{
// Scan the list of line cookers if there is anything familiar.
- list<line_cooker *>::iterator lci = kitchen.begin();
+ std::list<line_cooker *>::iterator lci = kitchen.begin();
pan = 0;
while (pan == 0 && lci != kitchen.end())
{