# ------------------------------------------------------------------------ Patch: webalizer-w3c For: Webalizer 2.01.10 From: Klaus Reimer Desc: Implement W3C extended log file format support. Version: 3 This patch implements W3C extended log file format support into webalizer. Thig log file format is used by Microsoft's Webserver IIS but other programs may also use this format which was invented by W3C. With this patch webalizer can read the W3C headers and can parse the data lines according to the specified Fields-header. Format-switching within a single logfile is supported. IIS is using this format-switching to write process accounting informations to the same logfile. These accounting informations are producing "bad record" warnings because these lines doesn't hold any informations usable for webalizer. You can just ignore them or disable process accounting logs in the IIS configuration if you don't need them IIS seems to be very buggy. I found three bugs in the current IIS version which affects logfiles: 1. If output buffering is enabled in ASP scripts the sc-bytes field is always 0. This prevents accurate measurement of download traffic. 2. Sometimes IIS writes nonsense into the log so the number of entries are not conform to the number of fields specified in the logfile header. This patch does its best to filter out these lines. 3. IIS writes a lot of Null-characters to the end of each logfile. These lines are ignored by this patch. Known Bugs in this patch: The user-agent field is not completely "urldecoded". Only the '+' signs are replaced by space characters. Other url-encoded characters are not touched. Changes since Version 2: * Forgot to check if a status field was found in the log data. That bug caused a seg fault if this field was missing. * Log lines without a URL are not processed and reported as "bad" now. In that way IIS log files which contains "process accounting informations" are processed correctly. Changes since Version 1: * A segfault occured if a field which is used by webalizer was missing in the logfile. This is now fixed, missing fields are silently ignored so they does not appear in the generated statistics. * Removed modifications for swedish and italian language file because the patch is not exchangeable between unix and windows with these modifications included. Help is appreciated. # ------------------------------------------------------------------------ diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.catalan webalizer-2.01.10/lang/webalizer_lang.catalan --- webalizer-2.01.10.orig/lang/webalizer_lang.catalan Thu Oct 19 03:43:45 2000 +++ webalizer-2.01.10/lang/webalizer_lang.catalan Thu Jun 6 09:01:25 2002 @@ -122,7 +122,7 @@ "-h = veure aquesta ajuda" , "-v -V = veure la versió del programa" , "-d = activar el mode trassa (depuració)" , - "-F tipus = tipus de fitxer de registre. tipus=(clf | ftp | squid)" , + "-F tipus = tipus de fitxer de registre. tipus=(clf | ftp | squid | w3c)" , "-f = ignorar errors de seqüència" , "-i = ignorar el fitxer" , "-p = conservem dades actuals (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.chinese webalizer-2.01.10/lang/webalizer_lang.chinese --- webalizer-2.01.10.orig/lang/webalizer_lang.chinese Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.chinese Thu Jun 6 09:01:31 2002 @@ -115,7 +115,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.croatian webalizer-2.01.10/lang/webalizer_lang.croatian --- webalizer-2.01.10.orig/lang/webalizer_lang.croatian Fri Jun 15 10:02:48 2001 +++ webalizer-2.01.10/lang/webalizer_lang.croatian Thu Jun 6 09:01:35 2002 @@ -114,7 +114,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.czech webalizer-2.01.10/lang/webalizer_lang.czech --- webalizer-2.01.10.orig/lang/webalizer_lang.czech Tue Apr 16 23:36:54 2002 +++ webalizer-2.01.10/lang/webalizer_lang.czech Thu Jun 6 09:00:21 2002 @@ -122,7 +122,7 @@ "-h = vypis tento help" , "-v -V = vypis informaci o verzi" , "-d = vypis dalsi ladici informace" , - "-F type = typ logu. type= (clf | ftp | squid)" , + "-F type = typ logu. type= (clf | ftp | squid | w3c)" , "-f = chyby v prekladu stranek" , "-i = ignoruj soubor historie" , "-p = zapamatuj stav (inkrementalne)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.danish webalizer-2.01.10/lang/webalizer_lang.danish --- webalizer-2.01.10.orig/lang/webalizer_lang.danish Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.danish Thu Jun 6 09:00:21 2002 @@ -115,7 +115,7 @@ "-h = udskriv denne hjælpebesked" , "-v -V = udskriv versionsoplysninger" , "-d = udskriv ekstra fejlsøgningsinformation", - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sekvensfejl" , "-i = ignorer historiefil" , "-p = bevar tilstand (inkremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.dutch webalizer-2.01.10/lang/webalizer_lang.dutch --- webalizer-2.01.10.orig/lang/webalizer_lang.dutch Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.dutch Thu Jun 6 09:00:21 2002 @@ -130,7 +130,7 @@ "-h = Deze helptekst", "-v -V = Toon versie-informatie", "-d = Debug informatie", - "-F type = Log formaat type. type= (clf | ftp | squid)", + "-F type = Log formaat type. type= (clf | ftp | squid | w3c)", "-f = Forceer chronologische volgorde", "-g = Gebruik GMT (UTC) tijd", "-i = Negeer 'history' bestand", diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.english webalizer-2.01.10/lang/webalizer_lang.english --- webalizer-2.01.10.orig/lang/webalizer_lang.english Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.english Thu Jun 6 14:01:18 2002 @@ -119,7 +119,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.estonian webalizer-2.01.10/lang/webalizer_lang.estonian --- webalizer-2.01.10.orig/lang/webalizer_lang.estonian Wed Jul 4 23:21:38 2001 +++ webalizer-2.01.10/lang/webalizer_lang.estonian Thu Jun 6 09:00:21 2002 @@ -103,7 +103,7 @@ "-h = kuva see help" , "-v -V = kuva versiooniinfo" , "-d = kuva täiendav debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = ignoreeri kirjete järjestuse vigu" , "-i = ignoreeri ajaloofaili" , "-p = säilita olek (inkrementaalne rezhiim)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.finnish webalizer-2.01.10/lang/webalizer_lang.finnish --- webalizer-2.01.10.orig/lang/webalizer_lang.finnish Sat Feb 10 03:26:29 2001 +++ webalizer-2.01.10/lang/webalizer_lang.finnish Thu Jun 6 09:00:21 2002 @@ -121,7 +121,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.french webalizer-2.01.10/lang/webalizer_lang.french --- webalizer-2.01.10.orig/lang/webalizer_lang.french Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.french Thu Jun 6 09:00:21 2002 @@ -150,7 +150,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.galician webalizer-2.01.10/lang/webalizer_lang.galician --- webalizer-2.01.10.orig/lang/webalizer_lang.galician Fri Jun 15 10:02:48 2001 +++ webalizer-2.01.10/lang/webalizer_lang.galician Thu Jun 6 09:00:21 2002 @@ -121,7 +121,7 @@ "-h = sacar esta mensaxe" , "-v -V = ver informacion de versión" , "-d = sacar información adicional para depuración" , - "-F type = Log type. type= (clf | ftp | squid)" , + "-F type = Log type. type= (clf | ftp | squid | w3c)" , "-f = procesa historicos fóra de secuencia (ver man)", "-i = ignorar arquivo" , "-p = lembrar estado (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.german webalizer-2.01.10/lang/webalizer_lang.german --- webalizer-2.01.10.orig/lang/webalizer_lang.german Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.german Thu Jun 6 09:00:21 2002 @@ -137,7 +137,7 @@ "-h = diese Hilfe ausgeben" , "-v = Version ausgeben" , "-d = zusätzliche Kontrolldaten ausgeben" , - "-F type = Art der Protokolldatei. type= (clf | ftp | squid)", + "-F type = Art der Protokolldatei. type= (clf | ftp | squid | w3c)", "-f = Ignoriere zeitliche Fehler bei Besuchen", "-i = Datei mit historischen Daten ignorieren", "-p = sichere Programmzustand (inkrementell)", diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.hungarian webalizer-2.01.10/lang/webalizer_lang.hungarian --- webalizer-2.01.10.orig/lang/webalizer_lang.hungarian Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.hungarian Thu Jun 6 09:00:21 2002 @@ -121,7 +121,7 @@ "-h = Kiírja ezt a sugó üzenetet" , "-v -V = Kiírja a verziószámot" , "-d = Kiírja a további debug infót" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Összefogja a sorozatos hibákat" , "-i = Mellõzi a history file-t" , "-p = Megõrzi az állapotott (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.icelandic webalizer-2.01.10/lang/webalizer_lang.icelandic --- webalizer-2.01.10.orig/lang/webalizer_lang.icelandic Sun Dec 17 05:49:25 2000 +++ webalizer-2.01.10/lang/webalizer_lang.icelandic Thu Jun 6 09:00:21 2002 @@ -125,7 +125,7 @@ "-h = prentar þessa hjálp" , "-v -V = prentar útgáfu upplýsingar" , "-d = print additional debug info" , - "-F tegund = Annála tegund. tegund= (clf | ftp | squid)", + "-F tegund = Annála tegund. tegund= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = hunsa history skrá" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.indonesian webalizer-2.01.10/lang/webalizer_lang.indonesian --- webalizer-2.01.10.orig/lang/webalizer_lang.indonesian Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.indonesian Thu Jun 6 09:00:22 2002 @@ -120,7 +120,7 @@ "-h = cetak pesan bantuan ini" , "-v -V = cetak informasi versi" , "-d = cetak informasi debug tambahan" , - "-F type = Log type. type= (clf | ftp | squid)" , + "-F type = Log type. type= (clf | ftp | squid | w3c)" , "-f = kesalahan urutan Fold" , "-i = abaikan file history" , "-p = menjaga pernyataan (penambahan)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.japanese webalizer-2.01.10/lang/webalizer_lang.japanese --- webalizer-2.01.10.orig/lang/webalizer_lang.japanese Tue Oct 23 07:46:24 2001 +++ webalizer-2.01.10/lang/webalizer_lang.japanese Thu Jun 6 09:00:22 2002 @@ -113,7 +113,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.korean webalizer-2.01.10/lang/webalizer_lang.korean --- webalizer-2.01.10.orig/lang/webalizer_lang.korean Fri Oct 20 05:54:20 2000 +++ webalizer-2.01.10/lang/webalizer_lang.korean Thu Jun 6 09:00:22 2002 @@ -116,7 +116,7 @@ "-h = µµ¿ò¸» È­¸é Ãâ·Â" , "-v -V = ÆÇ¹øÈ£ Ãâ·Â" , "-d = Ãß°¡ µð¹ö±ë Á¤º¸ Ãâ·Â" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = fold sequence errors" , "-i = È÷½ºÅ丮 ÆÄÀÏ ¹«½Ã" , "-p = Åë°è Á¤º¸ ÀúÀå (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.latvian webalizer-2.01.10/lang/webalizer_lang.latvian --- webalizer-2.01.10.orig/lang/webalizer_lang.latvian Thu Oct 19 04:59:56 2000 +++ webalizer-2.01.10/lang/webalizer_lang.latvian Thu Jun 6 09:00:22 2002 @@ -120,7 +120,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.malay webalizer-2.01.10/lang/webalizer_lang.malay --- webalizer-2.01.10.orig/lang/webalizer_lang.malay Tue Oct 31 02:44:47 2000 +++ webalizer-2.01.10/lang/webalizer_lang.malay Thu Jun 6 09:00:22 2002 @@ -120,7 +120,7 @@ "-h = cetak mesej pertolongan ini" , "-v -V = cetak maklumat versi" , "-d = cetak maklumat tambahan berkenaan dengan debug" , - "-F type = jenis Log. jenis= (clf | ftp | squid)", + "-F type = jenis Log. jenis= (clf | ftp | squid | w3c)", "-f = Alas turutan ralat" , "-i = abaikan fail terdahulu" , "-p = kekalkan keadaan (secara menaik)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.norwegian webalizer-2.01.10/lang/webalizer_lang.norwegian --- webalizer-2.01.10.orig/lang/webalizer_lang.norwegian Sat Nov 18 20:17:23 2000 +++ webalizer-2.01.10/lang/webalizer_lang.norwegian Thu Jun 6 09:00:22 2002 @@ -128,7 +128,7 @@ "-h = skriv hjelpetekst" , "-v -V = skriv versjonsinforasjon" , "-d = skriv ytterligere debuginformasjon" , - "-F typ = Loggtype. type= (clf | ftp | squid)" , + "-F typ = Loggtype. type= (clf | ftp | squid | w3c)" , "-f = hantere sekvensfeil" , "-i = ignorerer historiefilen" , "-p = bevar tillstand (inkrementell)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.polish webalizer-2.01.10/lang/webalizer_lang.polish --- webalizer-2.01.10.orig/lang/webalizer_lang.polish Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.polish Thu Jun 6 09:00:22 2002 @@ -123,7 +123,7 @@ "-h = wy¶wietla te informacje" , "-v -V = wy¶wietla informacje o wersji" , "-d = wy¶wietla dodatkowe informacje" , - "-F typ = typ logu. typ= (clf | ftp | squid)", + "-F typ = typ logu. typ= (clf | ftp | squid | w3c)", "-f = zignoruj b³êdy czasu kolejnych wywo³añ", "-i = pomija plik historii" , "-p = zachowuje stan (przyrostowy)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.portuguese webalizer-2.01.10/lang/webalizer_lang.portuguese --- webalizer-2.01.10.orig/lang/webalizer_lang.portuguese Tue Apr 16 23:37:00 2002 +++ webalizer-2.01.10/lang/webalizer_lang.portuguese Thu Jun 6 09:00:22 2002 @@ -123,7 +123,7 @@ "-h = mostra esta mensagem de ajuda" , "-v -V = mostra info sobre versao" , "-d = mostra info adicional para debug" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = fold sequence errors" , "-i = ignorar ficheiro de historico" , "-p = preservar estado (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.portuguese_brazil webalizer-2.01.10/lang/webalizer_lang.portuguese_brazil --- webalizer-2.01.10.orig/lang/webalizer_lang.portuguese_brazil Fri Oct 6 07:27:48 2000 +++ webalizer-2.01.10/lang/webalizer_lang.portuguese_brazil Thu Jun 6 09:00:22 2002 @@ -121,7 +121,7 @@ "-h = imprime esta mensagem de ajuda" , "-v -V = imprime a versão" , "-d = imprime informação adicional de depuração" , - "-F type = Log type. type= (clf | ftp | squid)" , + "-F type = Log type. type= (clf | ftp | squid | w3c)" , "-f = cruzar sequência de erros" , "-i = ignorar arquivo de histórico" , "-p = recuperar processamento anterior (incremento)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.romanian webalizer-2.01.10/lang/webalizer_lang.romanian --- webalizer-2.01.10.orig/lang/webalizer_lang.romanian Tue Oct 23 07:52:51 2001 +++ webalizer-2.01.10/lang/webalizer_lang.romanian Thu Jun 6 09:00:22 2002 @@ -117,7 +117,7 @@ "-h = afiseaza acest mesaj de ajutor" , "-v -V = afiseaza informatii despre versiune" , "-d = afiseaza informatii de depanare suplimentare" , - "-F type = Tip jurnal. type= (clf | ftp | squid)" , + "-F type = Tip jurnal. type= (clf | ftp | squid | w3c)" , "-f = eroare la secventa de fold" , "-i = ignora fisierul de istoric" , "-p = pastreaza starea (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.romanian-iso-8859-2 webalizer-2.01.10/lang/webalizer_lang.romanian-iso-8859-2 --- webalizer-2.01.10.orig/lang/webalizer_lang.romanian-iso-8859-2 Tue Oct 23 07:53:38 2001 +++ webalizer-2.01.10/lang/webalizer_lang.romanian-iso-8859-2 Thu Jun 6 09:00:22 2002 @@ -118,7 +118,7 @@ "-h = afiºeazã acest mesaj de ajutor" , "-v -V = afiºeazã informaþii despre versiune" , "-d = afiºeazã informaþii de depanare suplimentare" , - "-F type = Tip jurnal. type= (clf | ftp | squid)" , + "-F type = Tip jurnal. type= (clf | ftp | squid | w3c)" , "-f = eroare la secvenþa de fold" , "-i = ignorã fiºierul de istoric" , "-p = pãstreazã starea (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.russian webalizer-2.01.10/lang/webalizer_lang.russian --- webalizer-2.01.10.orig/lang/webalizer_lang.russian Fri Oct 6 07:27:49 2000 +++ webalizer-2.01.10/lang/webalizer_lang.russian Thu Jun 6 09:00:22 2002 @@ -129,7 +129,7 @@ "-h = ×ÙÄÁÔØ ÜÔÏ ÉÎÆÏÒÍÁÃÉÏÎÎÏÅ ÓÏÏÂÝÅÎÉÅ" , "-v -V = ×ÙÄÁÔØ ÉÎÆÏÒÍÁÃÉÀ Ï ×ÅÒÓÉÉ" , "-d = ×ÙÄÁ×ÁÔØ ÄÏÐÏÌÎÉÔÅÌØÎÕÀ ÏÔÌÁÄÏÞÎÕÀ ÉÎÆÏÒÍÁÃÉÀ" , - "-F ÔÉÐ = ×ÉÄ ÉÓÈÏÄÎÏÊ ÓÔÁÔÉÓÔÉËÉ. ÔÉÐ = (clf | ftp | squid)" , + "-F ÔÉÐ = ×ÉÄ ÉÓÈÏÄÎÏÊ ÓÔÁÔÉÓÔÉËÉ. ÔÉÐ = (clf | ftp | squid | w3c)" , "-f = fold sequence errors" , "-i = ÉÇÎÏÒÉÒÏ×ÁÔØ ÆÁÊÌ ÓÏÓÔÏÑÎÉÑ" , "-p = ÓÏÈÒÁÎÑÔØ ÉÎÆÏÒÍÁÃÉÀ Ï ÓÏÓÔÏÑÎÉÉ (ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏ)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.serbian webalizer-2.01.10/lang/webalizer_lang.serbian --- webalizer-2.01.10.orig/lang/webalizer_lang.serbian Thu Oct 19 03:43:45 2000 +++ webalizer-2.01.10/lang/webalizer_lang.serbian Thu Jun 6 09:00:22 2002 @@ -114,7 +114,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.simplified_chinese webalizer-2.01.10/lang/webalizer_lang.simplified_chinese --- webalizer-2.01.10.orig/lang/webalizer_lang.simplified_chinese Sun Dec 17 05:56:07 2000 +++ webalizer-2.01.10/lang/webalizer_lang.simplified_chinese Thu Jun 6 09:00:22 2002 @@ -113,7 +113,7 @@ "-h = ÏÔʾ±¾°ïÖúÐÅÏ¢" , "-v -V = ÏÔʾ±¾°æ±¾ÐÅÏ¢" , "-d = ÏÔʾ¸½¼ÓµÄµ÷ÊÔÐÅÏ¢" , - "-F type = ÈÕÖ¾ÀàÐÍ. ÀàÐÍ= (clf | ftp | squid)", + "-F type = ÈÕÖ¾ÀàÐÍ. ÀàÐÍ= (clf | ftp | squid | w3c)", "-f = ºÏ²¢´ÎÐò´íÎó?(Fold sequence errors)" , "-i = ºöÂÔÀúÊ·ÐÅÏ¢Îļþ" , "-p = ±£³Ö״̬ÐÅÏ¢(ÔöÁ¿·½Ê½)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.slovak webalizer-2.01.10/lang/webalizer_lang.slovak --- webalizer-2.01.10.orig/lang/webalizer_lang.slovak Fri Oct 6 07:27:49 2000 +++ webalizer-2.01.10/lang/webalizer_lang.slovak Thu Jun 6 09:00:22 2002 @@ -121,7 +121,7 @@ "-h = vypis tento help" , "-v -V = vypis informacie o verzii" , "-d = vypis dalsie ladiace informacie" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = oprav chyby postupnosti" , "-i = ignoruj subor historie" , "-p = zapamataj stav (inkrementalne)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.slovene webalizer-2.01.10/lang/webalizer_lang.slovene --- webalizer-2.01.10.orig/lang/webalizer_lang.slovene Fri Oct 6 07:27:49 2000 +++ webalizer-2.01.10/lang/webalizer_lang.slovene Thu Jun 6 09:00:22 2002 @@ -114,7 +114,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.spanish webalizer-2.01.10/lang/webalizer_lang.spanish --- webalizer-2.01.10.orig/lang/webalizer_lang.spanish Tue Apr 16 23:54:31 2002 +++ webalizer-2.01.10/lang/webalizer_lang.spanish Thu Jun 6 09:00:22 2002 @@ -128,7 +128,7 @@ "-h = mostrar este mensaje" , "-v -V = ver información de versión" , "-d = mostrar información adicional para depuración" , - "-F type = Log type. type= (clf | ftp | squid)" , + "-F type = Log type. type= (clf | ftp | squid | w3c)" , "-f = procesa históricos fuera de secuencia (ver man)", "-i = ignorar archivo" , "-p = recordar estado (incremental)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.turkish webalizer-2.01.10/lang/webalizer_lang.turkish --- webalizer-2.01.10.orig/lang/webalizer_lang.turkish Fri Oct 6 07:27:49 2000 +++ webalizer-2.01.10/lang/webalizer_lang.turkish Thu Jun 6 09:00:22 2002 @@ -119,7 +119,7 @@ "-h = bu yardim mesajini yazdir" , "-v -V = surum bilgilerini yazdir" , "-d = ek debug bilgileri yazir" , - "-F tip = kutuk tipi. 'tip'= (clf | ftp | squid)" , + "-F tip = kutuk tipi. 'tip'= (clf | ftp | squid | w3c)" , "-f = Siralama hatalarini duzelt" , "-i = history dosyasina bakma" , "-p = durumu koru (eklemeli)" , diff -ru webalizer-2.01.10.orig/lang/webalizer_lang.ukrainian webalizer-2.01.10/lang/webalizer_lang.ukrainian --- webalizer-2.01.10.orig/lang/webalizer_lang.ukrainian Fri Jun 15 10:02:49 2001 +++ webalizer-2.01.10/lang/webalizer_lang.ukrainian Thu Jun 6 09:00:22 2002 @@ -122,7 +122,7 @@ "-h = print this help message" , "-v -V = print version information" , "-d = print additional debug info" , - "-F type = Log type. type= (clf | ftp | squid)", + "-F type = Log type. type= (clf | ftp | squid | w3c)", "-f = Fold sequence errors" , "-i = ignore history file" , "-p = preserve state (incremental)" , diff -ru webalizer-2.01.10.orig/parser.c webalizer-2.01.10/parser.c --- webalizer-2.01.10.orig/parser.c Fri Jun 15 10:34:24 2001 +++ webalizer-2.01.10/parser.c Thu Jun 6 20:06:33 2002 @@ -68,6 +68,7 @@ int parse_record_web(char *); int parse_record_ftp(char *); int parse_record_squid(char *); +int parse_record_w3c(char *); /*********************************************/ /* FMT_LOGREC - terminate log fields w/zeros */ @@ -124,6 +125,7 @@ case LOG_CLF: return parse_record_web(buffer); break; /* clf */ case LOG_FTP: return parse_record_ftp(buffer); break; /* ftp */ case LOG_SQUID: return parse_record_squid(buffer); break; /* squid */ + case LOG_W3C: return parse_record_w3c(buffer); break; /* w3c */ } } @@ -498,5 +500,207 @@ while (*cp2==' ') *cp2--='\0'; /* we have no interest in the remaining fields */ + return 1; +} + +/*********************************************/ +/* PARSE_RECORD_W3C - w3c log handler */ +/*********************************************/ + +/* field index structure */ +struct field_index_struct +{ + int date; /* Date field index */ + int time; /* Time field index */ + int ip; /* IP field index */ + int username; /* Username field index */ + int method; /* Method field index */ + int url; /* URL field index */ + int query; /* Querystring field index */ + int status; /* Status code field index */ + int size; /* Size field index */ + int referer; /* Referrer field index */ + int agent; /* User agent field index */ + int fields; /* Number of fields in this format */ +}; + +/* field structure */ +struct fields_struct +{ + char *date; /* Date field */ + char *time; /* Time field */ + char *ip; /* IP field */ + char *username; /* Username field */ + char *url; /* URL field */ + char *query; /* Querystring */ + char *status; /* Status code */ + char *size; /* Size field */ + char *referer; /* Referrer field */ + char *agent; /* User agent field */ +}; + +int parse_record_w3c(char *buffer) +{ + int size; + char *eob; + char *cp; + int index; + static struct field_index_struct field_index; + struct fields_struct fields; + struct tm time; + + memset(&time, 0, sizeof(struct tm)); + size = strlen(buffer); /* get length of buffer */ + eob = buffer + size; /* calculate end of buffer */ + fmt_logrec(buffer); /* seperate fields with \0's */ + + cp = buffer; + + /* Check if the line is empty or a line suffers from the IIS + Null-Character bug and abort parsing if found. */ + if (*cp == '\0') return 0; + + /* If it's a header line ignore it or parse the Fields header if found */ + if (*cp == '#') + { + cp++; + if (!strcmp(cp, "Fields:")) + { + /* Reset the field indices */ + memset(&field_index, 0, sizeof(struct field_index_struct)); + while (*cp) cp++; + cp++; + index = 1; + while ((cp < eob) && (*cp != '\r') && (*cp != '\n')) + { + /* Set the field index */ + if (!strcmp(cp, "date")) field_index.date = index; + if (!strcmp(cp, "time")) field_index.time = index; + if (!strcmp(cp, "c-ip")) field_index.ip = index; + if (!strcmp(cp, "cs-uri-stem")) field_index.url = index; + if (!strcmp(cp, "cs-uri-query")) field_index.query = index; + if (!strcmp(cp, "sc-status")) field_index.status = index; + if (!strcmp(cp, "cs(Referer)")) field_index.referer = index; + if (!strcmp(cp, "sc-bytes")) field_index.size = index; + if (!strcmp(cp, "cs(User-Agent)")) field_index.agent = index; + if (!strcmp(cp, "cs-username")) field_index.username = index; + + /* Continue with the next field */ + while (*cp) cp++; + cp++; + index++; + } + field_index.fields = index -1; + } + + + /* Return because this header line is completely parsed */ + return 0; + } + + /* A data line has been found */ + + /* Check if the number of entries in this line are conform to the + format specified in the header */ + index = 1; + while ((cp < eob) && (*cp != '\r') && (*cp != '\n')) { + while (*cp) cp++; + cp++; + index++; + } + if (index-1 != field_index.fields) return 0; + + /* Reset pointer */ + cp = buffer; + + /* Reset the field pointers and begin parsing the data line */ + memset(&fields, 0, sizeof(struct fields_struct)); + index = 1; + while ((cp < eob) && (*cp != '\r') && (*cp != '\n')) + { + /* Set the field pointers */ + if (index == field_index.date) fields.date = cp; + if (index == field_index.time) fields.time = cp; + if (index == field_index.ip) fields.ip = cp; + if (index == field_index.url) fields.url = cp; + if (index == field_index.query) fields.query = cp; + if (index == field_index.status) fields.status = cp; + if (index == field_index.referer) fields.referer = cp; + if (index == field_index.size) fields.size = cp; + if (index == field_index.agent) fields.agent = cp; + if (index == field_index.username) fields.username = cp; + + /* Continue with the next data field */ + while (*cp) cp++; + cp++; + index++; + } + + /* Save URL */ + if (fields.url) + { + if (fields.query && (fields.query[0]!='-')) + snprintf(log_rec.url, MAXURL, "%s?%s", fields.url, fields.query); + else + strncpy(log_rec.url, fields.url, MAXURL - 1); + } else return 0; + + /* Save hostname */ + if (fields.ip) strncpy(log_rec.hostname, fields.ip, MAXHOST - 1); + + /* Save response code */ + if (fields.status) log_rec.resp_code = atoi(fields.status); + + /* Save referer */ + if (fields.referer) strncpy(log_rec.refer, fields.referer, MAXREF - 1); + + /* Save transfer size */ + if (fields.size) log_rec.xfer_size = strtoul(fields.size, NULL, 10); + + /* Save user agent */ + if (fields.agent) + { + cp = fields.agent; + while (*cp) + { + if (*cp == '+') *cp = ' '; + cp++; + } + strncpy(log_rec.agent, fields.agent, MAXAGENT - 1); + } + + /* Save auth username */ + if (fields.username) strncpy(log_rec.ident, fields.username, MAXIDENT - 1); + + /* Parse date and time and save it */ + if (fields.date) + { + time.tm_year = atoi(fields.date); + if (time.tm_year > 1900) time.tm_year-=1900; + while ((fields.date[0] != '\0') && (fields.date[0] != '-')) fields.date++; + if (fields.date[0] == '\0') return 0; + fields.date++; + time.tm_mon = atoi(fields.date) - 1; + while ((fields.date[0] != '\0') && (fields.date[0] != '-')) fields.date++; + if (fields.date[0] == '\0') return 0; + fields.date++; + time.tm_mday = atoi(fields.date); + } + if (fields.time) + { + time.tm_hour = atoi(fields.time); + while ((fields.time[0] != '\0') && (fields.time[0] != ':')) fields.time++; + if (fields.time[0] == '\0') return 0; + fields.time++; + time.tm_min = atoi(fields.time); + while ((fields.time[0] != '\0') && (fields.time[0] != ':')) fields.time++; + if (fields.time[0] == '\0') return 0; + fields.time++; + time.tm_sec = atoi(fields.time); + } + + strftime(log_rec.datetime, sizeof(log_rec.datetime), + "[%d/%b/%Y:%H:%M:%S -0000]", &time); + return 1; } diff -ru webalizer-2.01.10.orig/webalizer.c webalizer-2.01.10/webalizer.c --- webalizer-2.01.10.orig/webalizer.c Wed Apr 17 00:11:31 2002 +++ webalizer-2.01.10/webalizer.c Thu Jun 6 12:59:07 2002 @@ -287,7 +287,8 @@ case 'f': fold_seq_err=1; break; /* Fold sequence errs */ case 'F': log_type=(optarg[0]=='f')? LOG_FTP:(optarg[0]=='s')? - LOG_SQUID:LOG_CLF; break; /* define log type */ + LOG_SQUID:(optarg[0]=='w')? + LOG_W3C:LOG_CLF; break; /* define log type */ case 'g': group_domains=atoi(optarg); break; /* GroupDomains (0=no) */ case 'G': hourly_graph=0; break; /* no hourly graph */ case 'h': print_opts(argv[0]); break; /* help */ @@ -332,7 +333,7 @@ if (page_type==NULL) /* check if page types present */ { - if ((log_type == LOG_CLF) || (log_type == LOG_SQUID)) + if ((log_type == LOG_CLF) || (log_type == LOG_SQUID) || (log_type == LOG_W3C)) { add_nlist("htm*" ,&page_type); /* if no page types specified, we */ add_nlist("cgi" ,&page_type); /* use the default ones here... */ @@ -440,6 +441,7 @@ case LOG_CLF: printf("clf)\n"); break; case LOG_FTP: printf("ftp)\n"); break; case LOG_SQUID: printf("squid)\n"); break; + case LOG_W3C: printf("w3c)\n"); break; } } @@ -1272,13 +1274,21 @@ } else { - /* really bad record... */ - total_bad++; - if (verbose) + /* Check if it's a W3C header or IIS Null-Character line */ + if ((buffer[0]=='\0') || (buffer[0]=='#')) { - fprintf(stderr,"%s (%lu)",msg_bad_rec,total_rec); - if (debug_mode) fprintf(stderr,":\n%s\n",tmp_buf); - else fprintf(stderr,"\n"); + total_ignore++; + } + else + { + /* really bad record... */ + total_bad++; + if (verbose) + { + fprintf(stderr,"%s (%lu)",msg_bad_rec,total_rec); + if (debug_mode) fprintf(stderr,":\n%s\n",tmp_buf); + else fprintf(stderr,"\n"); + } } } } @@ -1560,7 +1570,8 @@ case 59: ntop_search = atoi(value); break; /* Top Search pgs */ case 60: log_type=(value[0]=='f')? LOG_FTP:((value[0]=='s')? - LOG_SQUID:LOG_CLF); break; /* LogType */ + LOG_SQUID:((value[0]=='w')? + LOG_W3C:LOG_CLF)); break; /* LogType */ case 61: add_glist(value,&search_list); break; /* SearchEngine */ case 62: group_domains=atoi(value); break; /* GroupDomains */ case 63: hide_sites=(value[0]=='y')?1:0; break; /* HideAllSites */ diff -ru webalizer-2.01.10.orig/webalizer.h webalizer-2.01.10/webalizer.h --- webalizer-2.01.10.orig/webalizer.h Sat Feb 10 01:58:18 2001 +++ webalizer-2.01.10/webalizer.h Thu Jun 6 08:01:36 2002 @@ -29,6 +29,7 @@ #define LOG_CLF 0 /* CLF/combined log type */ #define LOG_FTP 1 /* wu-ftpd xferlog type */ #define LOG_SQUID 2 /* squid proxy log */ +#define LOG_W3C 3 /* W3C extended log format */ /* Response code defines as per draft ietf HTTP/1.1 rev 6 */ #define RC_CONTINUE 100