![]() | |
![]() |
![]() ![]() ![]() ![]() |
![]() |
Analyze and count httpd access_logBecause an access-log file of Web server becomes very large within a short period, this file is renewed at the fixed interval - every week / month, etc. Here we assume the case that the log-file is renewed every month automatically. This is a very common case for many WWW servers. A default log-file of Apache (access_log) has following formatted lines.
Now let's count how many accesses are there during 24 hours. What we need is the "date" part (01) in [01/Jan/2000: . Count the number of lines those "date" is the same. This is done for the first day to 31th in a month.
In the access_log file, any kinds of Web access such as image files are recorded, so you need to exclude any log-lines other than the access to HTML files. You can also count an access to a definite file by changing if line in the Perl program. Firstly each line is separated into items (delimiter is white-space), then the "date" part is cut off by substr. Substitute this into the variable $day, and increment its counter. We named the Perl script above "webplot.pl". This is an example of access statistics to some Web Server in January, 2000, processed by "webplot.plt".
The following shows a graph drawn by gnuplot, dumb terminal. The letter < in "< webplot.pl access_log" means to read an output of Perl program.
|
![]() | |
![]() |
![]() ![]() ![]() ![]() |
![]() |