aclog: Unterschied zwischen den Versionen
Michi (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „Das Perl-Skript <b>aclog</b> (auch: AC.log) dient der Logdateianalyse eines Webservers. aclog löst weder die IP-Adressen in Rechner- und Domainnamen auf...“) |
Michi (Diskussion | Beiträge) |
||
Zeile 22: | Zeile 22: | ||
Aclog wird unter Angabe aller zu analysierenden Dateien aufgerufen und erzeugt als Ergebnis eine Textdatei. | Aclog wird unter Angabe aller zu analysierenden Dateien aufgerufen und erzeugt als Ergebnis eine Textdatei. | ||
$ <b>perl aclog access.log.01 | $ <b>perl aclog access.log.01 access.log.02 > ausgabe.txt</b> | ||
Konkret kann das wie folgt aussehen: | |||
$ <b>perl ~/backup/software/linux/Ubuntu8.04/test/aclog /var/log/apache2/access.log > \ | |||
/tmp/access.txt</b> | |||
Das Ergebnis sieht beispielsweise wie folgt aus: | |||
<pre> | |||
* | |||
* AC.log version 1.0beta build 0003 | |||
* Advanced HTTP server log file analyser | |||
* Copyright (C) 1999 Christian Treber | |||
* For information, see www.ctreber.de/AC.log/ or contact ac.log@ctreber.de | |||
* | |||
* AC.log is licensed to you under the GNU General Public License version 2. | |||
* AC.log comes with ABSOLUTELY NO WARRANTY; This is free software, | |||
* and you are welcome to redistribute it under certain conditions. | |||
* | |||
* | |||
* General information | |||
* | |||
Logfile(s): /var/log/apache2/access.log | |||
Time range: 02.08.2009 11:55:54 to 06.08.2009 12:08:05 | |||
Entries processed: 226 read, 210 inspected, 16 filtered out | |||
Transferred volume: 110083 bytes (107.5kB) | |||
Sessions: 31 sessions with 4.0h total duration (463.5sec per session) | |||
* | |||
* Originating page (referrer) by number of requests | |||
* | |||
68.1% 68.1% 143 - | |||
30.0% 98.1% 63 http://localhost/wiki_privat/index.php/Hauptseite | |||
1.0% 99.0% 2 http://localhost/wiki_privat/index.php?title=Personen&action | |||
=edit | |||
0.5% 99.5% 1 http://localhost/wiki_privat/index.php/Personen | |||
0.5% 100.0% 1 http://localhost/wiki_privat/index.php/External_server_kuhn2 | |||
* | |||
* Session entry page by number of sessions | |||
* | |||
93.8% 93.8% 30 /wiki_privat/ | |||
3.1% 96.9% 1 /wiki_privat/index.php/Hauptseite | |||
3.1% 100.0% 1 * | |||
* | |||
* Pages by number of views | |||
* | |||
25.7% 25.7% 54 /wiki_privat/index.php | |||
23.8% 49.5% 50 /wiki_privat/index.php/Hauptseite | |||
23.8% 73.3% 50 /wiki_privat/ | |||
16.7% 90.0% 35 * | |||
3.8% 93.8% 8 /favicon.ico | |||
1.4% 95.2% 3 /wiki_privat/index.php/External_server_kuhn2 | |||
1.0% 96.2% 2 /wiki_privat/index.php/Wetter | |||
1.0% 97.1% 2 /wiki_privat/index.php/Personen | |||
1.0% 98.1% 2 /wiki_privat/index.php/External_server_kuhn | |||
0.5% 98.6% 1 /wiki_privat/index.php/Passw%C3%B6rter | |||
0.5% 99.0% 1 /wiki_privat/index.php/Gesundheit | |||
0.5% 99.5% 1 /wiki_privat/index.php/Finanzen | |||
0.5% 100.0% 1 /wiki_privat/index.php/External_server_kuhn2/Konfiguration_G | |||
%C3%A4stebuch | |||
* | |||
* Pages by view time | |||
* | |||
636.7sec /wiki_privat/index.php/External_server_kuhn2 (3 times) | |||
367.0sec /wiki_privat/index.php/Finanzen (1 times) | |||
316.0sec /favicon.ico (5 times) | |||
200.9sec /wiki_privat/index.php/Hauptseite (34 times) | |||
200.5sec /wiki_privat/index.php/External_server_kuhn (2 times) | |||
61.7sec /wiki_privat/index.php (51 times) | |||
19.0sec /wiki_privat/index.php/External_server_kuhn2/Konfiguration_G%C3%A4st | |||
ebuch (1 times) | |||
2.2sec /wiki_privat/ (50 times) | |||
2.0sec /wiki_privat/index.php/Personen (1 times) | |||
0.0sec * (31 times) | |||
* | |||
* Session exit page by number of sessions | |||
* | |||
51.6% 51.6% 16 /wiki_privat/index.php/Hauptseite | |||
12.9% 64.5% 4 * | |||
9.7% 74.2% 3 /wiki_privat/index.php | |||
9.7% 83.9% 3 /favicon.ico | |||
6.5% 90.3% 2 /wiki_privat/index.php/Wetter | |||
3.2% 93.5% 1 /wiki_privat/index.php/Personen | |||
3.2% 96.8% 1 /wiki_privat/index.php/Passw%C3%B6rter | |||
3.2% 100.0% 1 /wiki_privat/index.php/Gesundheit | |||
* | |||
* Files by number of requests | |||
* | |||
25.7% 25.7% 54 /wiki_privat/index.php | |||
23.8% 49.5% 50 /wiki_privat/index.php/Hauptseite | |||
23.8% 73.3% 50 /wiki_privat/ | |||
16.7% 90.0% 35 * | |||
3.8% 93.8% 8 /favicon.ico | |||
1.4% 95.2% 3 /wiki_privat/index.php/External_server_kuhn2 | |||
1.0% 96.2% 2 /wiki_privat/index.php/Wetter | |||
1.0% 97.1% 2 /wiki_privat/index.php/Personen | |||
1.0% 98.1% 2 /wiki_privat/index.php/External_server_kuhn | |||
0.5% 98.6% 1 /wiki_privat/index.php/Passw%C3%B6rter | |||
0.5% 99.0% 1 /wiki_privat/index.php/Gesundheit | |||
0.5% 99.5% 1 /wiki_privat/index.php/Finanzen | |||
0.5% 100.0% 1 /wiki_privat/index.php/External_server_kuhn2/Konfiguration_G | |||
%C3%A4stebuch | |||
* | |||
* File type by volume (bytes total, bytes per document, number of requests) | |||
* | |||
20.9% 20.9% 13.3kB 6.7kB 2 php/External_server_kuhn | |||
17.1% 38.0% 10.9kB 207.6 B 54 php | |||
12.0% 49.9% 7.6kB 7.6kB 1 php/Finanzen | |||
10.3% 60.3% 6.6kB 6.6kB 1 php/Passw%C3%B6rter | |||
9.8% 70.0% 6.2kB 3.1kB 2 php/Personen | |||
7.2% 77.2% 4.6kB 1.5kB 3 php/External_server_kuhn2 | |||
6.5% 83.7% 4.2kB 4.2kB 1 php/External_server_kuhn2/Konfiguration_G%C3 | |||
%A4stebuch | |||
5.7% 89.5% 3.7kB 3.7kB 1 php/Gesundheit | |||
4.6% 94.1% 2.9kB 1.5kB 2 php/Wetter | |||
4.0% 98.0% 2.5kB 323.0 B 8 ico | |||
2.0% 100.0% 1.3kB 15.3 B 85 | |||
0.0% 100.0% 0.0 B 0.0 B 50 php/Hauptseite | |||
* | |||
* Requesting host by number of requests (time of last access) | |||
* | |||
100.0% 100.0% 210 127.0.0.1 () last at 06.08.2009 12:08:05 | |||
* | |||
* Requesting domain by number of requests (time of last access) | |||
* | |||
) last at 06.08.2009 12:08:05 (unresolved | |||
* | |||
* Top Level Domain by number of requests | |||
* | |||
) | |||
* | |||
* Result code by number of requests | |||
* | |||
46.2% 46.2% 97 200 OK | |||
25.7% 71.9% 54 304 Not Modified | |||
23.8% 95.7% 50 301 Moved Permanently | |||
3.8% 99.5% 8 404 Not Found | |||
0.5% 100.0% 1 302 Found | |||
* | |||
* Protocol by number of requests | |||
* | |||
83.3% 83.3% 175 HTTP/1.1 | |||
16.7% 100.0% 35 HTTP/1.0 | |||
* | |||
* Browser by number of requests (plus version: % relative to browser/to all requ | |||
ests) | |||
* | |||
69.0% 69.0% 145 Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.12) Gecko/2009 | |||
070812 Ubuntu (8.04: 100.0%/69.0%) | |||
16.7% 85.7% 35 Apache/2.2.8 (Ubuntu) PHP (5.2.4-2ubuntu5.6 with Suhosin-Pat | |||
ch: 100.0%/16.7%) | |||
14.3% 100.0% 30 Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.13) Gecko/2009 | |||
080316 Ubuntu (8.04: 100.0%/14.3%) | |||
* | |||
* Platform by number of requests (plus version: % relative to platform/to all re | |||
quests) | |||
* | |||
83.3% 83.3% 175 hardy (unknown: 100.0%/83.3%) | |||
16.7% 100.0% 35 internal (dummy connection: 100.0%/16.7%) | |||
* | |||
* Distribution of requests over the day | |||
* | |||
15.7% 15.7% 33 00 ************************************************** | |||
12.4% 28.1% 26 01 ======================================= | |||
1.9% 30.0% 4 02 ====== | |||
11.9% 41.9% 25 03 ===================================== | |||
0.0% 41.9% 0 04 | |||
0.0% 41.9% 0 05 | |||
0.0% 41.9% 0 06 | |||
0.0% 41.9% 0 07 | |||
3.3% 45.2% 7 08 ========== | |||
7.6% 52.9% 16 09 ======================== | |||
0.0% 52.9% 0 10 | |||
10.5% 63.3% 22 11 ================================= | |||
3.3% 66.7% 7 12 ========== | |||
0.0% 66.7% 0 13 | |||
9.5% 76.2% 20 14 ============================== | |||
2.4% 78.6% 5 15 ======= | |||
0.0% 78.6% 0 16 | |||
3.8% 82.4% 8 17 ============ | |||
5.7% 88.1% 12 18 ================== | |||
7.1% 95.2% 15 19 ====================== | |||
0.0% 95.2% 0 20 | |||
0.0% 95.2% 0 21 | |||
1.0% 96.2% 2 22 === | |||
3.8% 100.0% 8 23 ============ | |||
* | |||
* Distribution of requests over the week | |||
* | |||
29.5% 29.5% 62 Mon ************************************************** | |||
25.7% 55.2% 54 Tue =========================================== | |||
21.9% 77.1% 46 Wed ===================================== | |||
10.0% 87.1% 21 Thu ================ | |||
0.0% 87.1% 0 Fri | |||
0.0% 87.1% 0 Sat | |||
12.9% 100.0% 27 Sun ===================== | |||
* | |||
* Requests per date | |||
* | |||
12.9% 12.9% 27 2009-08-02 ===================== | |||
29.5% 42.4% 62 2009-08-03 ************************************************* | |||
* | |||
25.7% 68.1% 54 2009-08-04 =========================================== | |||
21.9% 90.0% 46 2009-08-05 ===================================== | |||
10.0% 100.0% 21 2009-08-06 ================ | |||
</pre> | |||
== Weblinks == | == Weblinks == |
Version vom 6. August 2009, 11:49 Uhr
Das Perl-Skript aclog (auch: AC.log) dient der Logdateianalyse eines Webservers.
aclog löst weder die IP-Adressen in Rechner- und Domainnamen auf, noch kann der Weg des Besuchers verfolgt werden. Dafür gibt es eine Tabelle der häufigsten Einstiegsseiten ("Session Entry Pages"), die Verweildauer pro Seite und die häufigsten Ausstiegsseiten ("Session Exit Pages"). Im weiteren werden die Anfragen nach Tag und Woche geordnet.
Installation
Vorbedingung ist Perl 5 oder höher.
Ubuntu 8.04 Hardy Heron
Herunterladen: http://www.ctreber.de/commercial/aclog/download.html
$ mkdir aclog && mv aclog10.tgz aclog && cd aclog $ tar xzf aclog10.tgz
Konfiguration
Eine weitergehende Konfiguration muss im Perl-Skript selbst vorgenommen werden.
Verwendung
Aclog wird unter Angabe aller zu analysierenden Dateien aufgerufen und erzeugt als Ergebnis eine Textdatei.
$ perl aclog access.log.01 access.log.02 > ausgabe.txt
Konkret kann das wie folgt aussehen:
$ perl ~/backup/software/linux/Ubuntu8.04/test/aclog /var/log/apache2/access.log > \ /tmp/access.txt
Das Ergebnis sieht beispielsweise wie folgt aus:
* * AC.log version 1.0beta build 0003 * Advanced HTTP server log file analyser * Copyright (C) 1999 Christian Treber * For information, see www.ctreber.de/AC.log/ or contact ac.log@ctreber.de * * AC.log is licensed to you under the GNU General Public License version 2. * AC.log comes with ABSOLUTELY NO WARRANTY; This is free software, * and you are welcome to redistribute it under certain conditions. * * * General information * Logfile(s): /var/log/apache2/access.log Time range: 02.08.2009 11:55:54 to 06.08.2009 12:08:05 Entries processed: 226 read, 210 inspected, 16 filtered out Transferred volume: 110083 bytes (107.5kB) Sessions: 31 sessions with 4.0h total duration (463.5sec per session) * * Originating page (referrer) by number of requests * 68.1% 68.1% 143 - 30.0% 98.1% 63 http://localhost/wiki_privat/index.php/Hauptseite 1.0% 99.0% 2 http://localhost/wiki_privat/index.php?title=Personen&action =edit 0.5% 99.5% 1 http://localhost/wiki_privat/index.php/Personen 0.5% 100.0% 1 http://localhost/wiki_privat/index.php/External_server_kuhn2 * * Session entry page by number of sessions * 93.8% 93.8% 30 /wiki_privat/ 3.1% 96.9% 1 /wiki_privat/index.php/Hauptseite 3.1% 100.0% 1 * * * Pages by number of views * 25.7% 25.7% 54 /wiki_privat/index.php 23.8% 49.5% 50 /wiki_privat/index.php/Hauptseite 23.8% 73.3% 50 /wiki_privat/ 16.7% 90.0% 35 * 3.8% 93.8% 8 /favicon.ico 1.4% 95.2% 3 /wiki_privat/index.php/External_server_kuhn2 1.0% 96.2% 2 /wiki_privat/index.php/Wetter 1.0% 97.1% 2 /wiki_privat/index.php/Personen 1.0% 98.1% 2 /wiki_privat/index.php/External_server_kuhn 0.5% 98.6% 1 /wiki_privat/index.php/Passw%C3%B6rter 0.5% 99.0% 1 /wiki_privat/index.php/Gesundheit 0.5% 99.5% 1 /wiki_privat/index.php/Finanzen 0.5% 100.0% 1 /wiki_privat/index.php/External_server_kuhn2/Konfiguration_G %C3%A4stebuch * * Pages by view time * 636.7sec /wiki_privat/index.php/External_server_kuhn2 (3 times) 367.0sec /wiki_privat/index.php/Finanzen (1 times) 316.0sec /favicon.ico (5 times) 200.9sec /wiki_privat/index.php/Hauptseite (34 times) 200.5sec /wiki_privat/index.php/External_server_kuhn (2 times) 61.7sec /wiki_privat/index.php (51 times) 19.0sec /wiki_privat/index.php/External_server_kuhn2/Konfiguration_G%C3%A4st ebuch (1 times) 2.2sec /wiki_privat/ (50 times) 2.0sec /wiki_privat/index.php/Personen (1 times) 0.0sec * (31 times) * * Session exit page by number of sessions * 51.6% 51.6% 16 /wiki_privat/index.php/Hauptseite 12.9% 64.5% 4 * 9.7% 74.2% 3 /wiki_privat/index.php 9.7% 83.9% 3 /favicon.ico 6.5% 90.3% 2 /wiki_privat/index.php/Wetter 3.2% 93.5% 1 /wiki_privat/index.php/Personen 3.2% 96.8% 1 /wiki_privat/index.php/Passw%C3%B6rter 3.2% 100.0% 1 /wiki_privat/index.php/Gesundheit * * Files by number of requests * 25.7% 25.7% 54 /wiki_privat/index.php 23.8% 49.5% 50 /wiki_privat/index.php/Hauptseite 23.8% 73.3% 50 /wiki_privat/ 16.7% 90.0% 35 * 3.8% 93.8% 8 /favicon.ico 1.4% 95.2% 3 /wiki_privat/index.php/External_server_kuhn2 1.0% 96.2% 2 /wiki_privat/index.php/Wetter 1.0% 97.1% 2 /wiki_privat/index.php/Personen 1.0% 98.1% 2 /wiki_privat/index.php/External_server_kuhn 0.5% 98.6% 1 /wiki_privat/index.php/Passw%C3%B6rter 0.5% 99.0% 1 /wiki_privat/index.php/Gesundheit 0.5% 99.5% 1 /wiki_privat/index.php/Finanzen 0.5% 100.0% 1 /wiki_privat/index.php/External_server_kuhn2/Konfiguration_G %C3%A4stebuch * * File type by volume (bytes total, bytes per document, number of requests) * 20.9% 20.9% 13.3kB 6.7kB 2 php/External_server_kuhn 17.1% 38.0% 10.9kB 207.6 B 54 php 12.0% 49.9% 7.6kB 7.6kB 1 php/Finanzen 10.3% 60.3% 6.6kB 6.6kB 1 php/Passw%C3%B6rter 9.8% 70.0% 6.2kB 3.1kB 2 php/Personen 7.2% 77.2% 4.6kB 1.5kB 3 php/External_server_kuhn2 6.5% 83.7% 4.2kB 4.2kB 1 php/External_server_kuhn2/Konfiguration_G%C3 %A4stebuch 5.7% 89.5% 3.7kB 3.7kB 1 php/Gesundheit 4.6% 94.1% 2.9kB 1.5kB 2 php/Wetter 4.0% 98.0% 2.5kB 323.0 B 8 ico 2.0% 100.0% 1.3kB 15.3 B 85 0.0% 100.0% 0.0 B 0.0 B 50 php/Hauptseite * * Requesting host by number of requests (time of last access) * 100.0% 100.0% 210 127.0.0.1 () last at 06.08.2009 12:08:05 * * Requesting domain by number of requests (time of last access) * ) last at 06.08.2009 12:08:05 (unresolved * * Top Level Domain by number of requests * ) * * Result code by number of requests * 46.2% 46.2% 97 200 OK 25.7% 71.9% 54 304 Not Modified 23.8% 95.7% 50 301 Moved Permanently 3.8% 99.5% 8 404 Not Found 0.5% 100.0% 1 302 Found * * Protocol by number of requests * 83.3% 83.3% 175 HTTP/1.1 16.7% 100.0% 35 HTTP/1.0 * * Browser by number of requests (plus version: % relative to browser/to all requ ests) * 69.0% 69.0% 145 Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.12) Gecko/2009 070812 Ubuntu (8.04: 100.0%/69.0%) 16.7% 85.7% 35 Apache/2.2.8 (Ubuntu) PHP (5.2.4-2ubuntu5.6 with Suhosin-Pat ch: 100.0%/16.7%) 14.3% 100.0% 30 Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.13) Gecko/2009 080316 Ubuntu (8.04: 100.0%/14.3%) * * Platform by number of requests (plus version: % relative to platform/to all re quests) * 83.3% 83.3% 175 hardy (unknown: 100.0%/83.3%) 16.7% 100.0% 35 internal (dummy connection: 100.0%/16.7%) * * Distribution of requests over the day * 15.7% 15.7% 33 00 ************************************************** 12.4% 28.1% 26 01 ======================================= 1.9% 30.0% 4 02 ====== 11.9% 41.9% 25 03 ===================================== 0.0% 41.9% 0 04 0.0% 41.9% 0 05 0.0% 41.9% 0 06 0.0% 41.9% 0 07 3.3% 45.2% 7 08 ========== 7.6% 52.9% 16 09 ======================== 0.0% 52.9% 0 10 10.5% 63.3% 22 11 ================================= 3.3% 66.7% 7 12 ========== 0.0% 66.7% 0 13 9.5% 76.2% 20 14 ============================== 2.4% 78.6% 5 15 ======= 0.0% 78.6% 0 16 3.8% 82.4% 8 17 ============ 5.7% 88.1% 12 18 ================== 7.1% 95.2% 15 19 ====================== 0.0% 95.2% 0 20 0.0% 95.2% 0 21 1.0% 96.2% 2 22 === 3.8% 100.0% 8 23 ============ * * Distribution of requests over the week * 29.5% 29.5% 62 Mon ************************************************** 25.7% 55.2% 54 Tue =========================================== 21.9% 77.1% 46 Wed ===================================== 10.0% 87.1% 21 Thu ================ 0.0% 87.1% 0 Fri 0.0% 87.1% 0 Sat 12.9% 100.0% 27 Sun ===================== * * Requests per date * 12.9% 12.9% 27 2009-08-02 ===================== 29.5% 42.4% 62 2009-08-03 ************************************************* * 25.7% 68.1% 54 2009-08-04 =========================================== 21.9% 90.0% 46 2009-08-05 ===================================== 10.0% 100.0% 21 2009-08-06 ================