I forgot to mention that we currently have "one big log" (I will be
breaking it up into chunks in a month or so). I was able to re-run
everything by modifying the script to read the shortdate off the command
line...
daily.sh 000925
would process the data for that day and then create
/wwwlogs/20000925/index.html
Put this in a script and then repeated the lines incrementing the date.
Processed 0915 - 1208 in about 1/2 and hour... sweet!
Thanks all!
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.
On Fri, 8 Dec 2000, Tim Pickering wrote:
> 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]/
------------------------------------------------------------------------