Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What I would like is a script that will tail the access log of my web server for a given number seconds. Then I can run this script once an hour or at a given time to see how many pages are being loaded per second.
I tried using alarm to do something like this but it doesn't seem to work as I had hoped. Here's what I've tried so far.
Thanks, Aaron#!/usr/bin/perl open ACCESS, "|tail -f /var/log/apache/access.log"; eval{ alarm(10); while(<ACCESS>){ print; } }; close ACCESS;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(ar0n: our hero CPAN) Re: Tailing the access log
by ar0n (Priest) on Mar 30, 2001 at 01:02 UTC | |
|
Re: Tailing the access log
by Masem (Monsignor) on Mar 30, 2001 at 00:43 UTC | |
|
Re: Tailing the access log
by runrig (Abbot) on Mar 30, 2001 at 00:49 UTC | |
|
Re: Tailing the access log
by tinman (Curate) on Mar 30, 2001 at 01:01 UTC | |
|
Re: Tailing the access log
by Dominus (Parson) on Mar 30, 2001 at 08:28 UTC | |
|
Re: Tailing the access log
by physi (Friar) on Mar 30, 2001 at 12:58 UTC |