Your perl time troubles can be settled by installing the DateCalc.pm (perl module),
you can probably get it from www.cpan.org.
The problem I thought you were asking to solve was how you go back through and re run
the stats for all the logs that have been processed with some other reports done (eg
ALL instead of DAILY).
I'm faced with a similar situation and in my case I think I am going to use
DateCalc.pm and the first date in my logs, do a for loop from 1 to the number of days
between first date and yesterday (DateCalc). Then follow a similar pattern as
described here.
My other concern is the continually outputting of the same file name, so that will
have to be changed as well. I'm probably going to implement a stats/YYYY/MM/HOST/
type directory structure, and build log names based on the date file by month. I'm
busy and haven't gotten a chance to hack this little script together, but if there is
interest I will post it here when I am done.
Jeff
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
> Thanks a lot, I guess this will serve my wishes.
> Btw, there seems not to be something like a "visits"-analyze in analog, like
> e.g. in webalizer.
> Am I right?
>
> -----Original Message-----
> From: Tim Pickering [mailto:[EMAIL PROTECTED]]
> Sent: Freitag, 8. Dezember 2000 12:02
> To: [EMAIL PROTECTED]
> Subject: RE: [analog-help] ACK - Daily stats
>
>
> Yes if you want a different report for each log, assuming that one log
> contains entries for only one website.
>
> They way I do this is to run the cron job the day after the day I want stats
> for. So on Tuesday it'll analyse Monday's log entries etc. This can can be
> automated if you use something like perl to generate the date you want to
> analyse in your log file. A perl script can grab the system date, minus the
> day by one and write the value into the 'FROM' and 'TO' options in
> analog.cfg
>
> This is how you'd capture the time and get the previous day:
>
>
> $time = (time);
> $time = $time - 86400;
> $date = (gmtime($time));
>
>
> You have to put elements of the date into an array to remove some
> formatting:
>
>
> $date =~s/\s+/|/g;
> @units = split(/\|/,$date);
>
>
> And this takes the contents of the array and puts them in variables:
>
>
> $year = "$units[4]";
> $long_year = $year;
> $year =~ s/\d{2}//;
> $month = "$units[1]";
> $day = "$units[2]";
> $n = 0;
> $zero = 0;
> $line = 1;
> $report = "report.html";
>
>
> Because analog uses numeric values in the 'FROM' and 'TO' you have to create
> an array of months:
>
>
> @months_list = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec));
>
>
> and choose the correct number of the month in the year, so December is
> obviously 12:
>
>
> while ($month ne $months_list[$n]) {
> $n++;
> }
> $month_num = $n + 1;
>
>
> Then you can generate the values for 'FROM' and 'TO' with the following
> line:
>
>
> print NEWFILE "FROM $year$month_num$zero$day\nTO
> $year$month_num$zero$day";
>
>
> I guess I should have mentioned that a working knowledge of perl is required
> to understand/set this up, but to be honest I learnt the perl basics just to
> do this and once you get the hang of it you can automate analog in various
> ways with different options.
>
> Hope this at least gives you some ideas : )
>
> Tim
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
> > Sent: 08 December 2000 10:20
> > To: [EMAIL PROTECTED]
> > Subject: RE: [analog-help] ACK - Daily stats
> >
> >
> > Right! Analog is running on linux platform and I want to automate
> > my reports
> > on a daily basis. Of course
> > by some linux cron job. It seems as if I have to run analog over
> > all my logs
> > or at least over some cached
> > log files. Am I right?
> >
> > -----Original Message-----
> > From: Tim Pickering [mailto:[EMAIL PROTECTED]]
> > Sent: Freitag, 8. Dezember 2000 11:18
> > To: [EMAIL PROTECTED]
> > Subject: RE: [analog-help] ACK - Daily stats
> >
> >
> > Are you intending to automate your daily reports using a
> > scheduling service
> > like Cron on Unix or the AT schedule on NT?
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of Orion (Steve
> > > Pirk)
> > > Sent: 07 December 2000 23:44
> > > To: [EMAIL PROTECTED]
> > > Subject: [analog-help] ACK - Daily stats
> > >
> > >
> > > I thought I was being cool and provided management with "cumulative
> > > stats" (from day one to now). Turns out that they would prefer a
> > > daily report detailing yesterday's activities.
> > >
> > > My first idea is to make each one of these reports it's own driectory,
> > > and dump data there for posterity. I would also look into using the
> > > "FROM TO" flags to limit the data.
> > >
> > > While I start planning this out, if anyone has some good tips to either
> > > cut off some time, or save me from painting myself into a corner, I
> > > would *really* appreciate it.
> > >
> > > Steve
> > > [EMAIL PROTECTED] - owner/admin | Chaos reigns within.
> > > http://www.deathcon.com | Reflect, repent, and reboot.
> > > Think of it as evolution in action. | Order shall return.
> > >
> > >
> > > ------------------------------------------------------------------------
> > > This is the analog-help mailing list. To unsubscribe from this
> > > mailing list, send mail to [EMAIL PROTECTED]
> > > with "unsubscribe" in the main BODY OF THE MESSAGE.
> > > List archived at
> > http://www.mail-archive.com/[email protected]/
> > > ------------------------------------------------------------------------
> > >
> >
> > ------------------------------------------------------------------------
> > This is the analog-help mailing list. To unsubscribe from this
> > mailing list, send mail to [EMAIL PROTECTED]
> > with "unsubscribe" in the main BODY OF THE MESSAGE.
> > List archived at http://www.mail-archive.com/[email protected]/
> > ------------------------------------------------------------------------
> > ------------------------------------------------------------------------
> > This is the analog-help mailing list. To unsubscribe from this
> > mailing list, send mail to [EMAIL PROTECTED]
> > with "unsubscribe" in the main BODY OF THE MESSAGE.
> > List archived at http://www.mail-archive.com/[email protected]/
> > ------------------------------------------------------------------------
> >
>
> ------------------------------------------------------------------------
> This is the analog-help mailing list. To unsubscribe from this
> mailing list, send mail to [EMAIL PROTECTED]
> with "unsubscribe" in the main BODY OF THE MESSAGE.
> List archived at http://www.mail-archive.com/[email protected]/
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> This is the analog-help mailing list. To unsubscribe from this
> mailing list, send mail to [EMAIL PROTECTED]
> with "unsubscribe" in the main BODY OF THE MESSAGE.
> List archived at http://www.mail-archive.com/[email protected]/
> ------------------------------------------------------------------------
------------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe" in the main BODY OF THE MESSAGE.
List archived at http://www.mail-archive.com/[email protected]/
------------------------------------------------------------------------