Hi Gary,

  Small world, indeed!  Yes, USL "graduated" to its new name
(University of Louisiana at Lafayette) on September 10, 1999.
The athletic teams are now called Louisiana's Ragin' Cajuns.
We had some wonderful football when Brandon Stokely was QB
just a few years ago, but the team is struggling this year.
Overall, other sports are doing well.

  Concerning your analog situation, 'sed' might be helpful
as it's possible to denote text at the beginning of a line
or at the end of the line (^ for BOL, and $ for EOL).  The
following example might be useful.  Note that the script
creates a new file for the updated content and preserves
the original content (old filename with '.old' extension).
Of course, the original file should already be circulated
out of active logging.  At UL Lafayette, we maintain logs
for four weeks.  At the end of the week, we stop the HTTP
server, rename the log file, restart the server, analyze
the log file, and zip it.  After this, the oldest zipped
log file is deleted from the server to conserve space.
As to LOGFORMAT, I leave that to the analog wizards on
the list.  Some of these folks know analog inside out.

-- Duke


#!/bin/csh

cd /directory/subdirectory # change to subdirectory where the action is

# foreach file ( *.txt ) # call files by extension(s)
foreach file ( file1 file2 ) # call files by filename(s)

  sed 's/c$/200/' < $file > $file.tmp # parse log file, create temp file
  sed 's/i$/404/' < $file.tmp > $file.new # parse temp, create perm file
  rm $file.tmp # keep the old file around just in case # remove temp
  mv $file $file.old # keep the original log file around just in case
  mv $file.new $file # call the new file by the old name for apps sake

end


Gary Kliethermes wrote:

> Hi Duke,
>
> Thanks for the response.  I'm using Red Hat Linux, version 6.2, and although
> I've been running a web hosting service (on NT)  for over 4 years, I'm new
> to the Unix world.
>
> If I understand you correctly, you're suggesting that I run 'sed' against
> the logfile (/var/log/xferlog) and replace the 'i' and 'c' at the
> end-of-line before using Analog to create a report.  Correct?
>
> If this is correct, could you give an example of how to use sed to do this?
> I looked at the man page for it, and I'm guessing that I would use the
> 's/regexp/replacement/' option in sed, but I'm hesitant to try it on a
> running machine.
>
> Do you have any suggestions on what the LOGFORMAT command should look like
> in order to process the log after the change?
>
> UL Lafayette?  Isn't that the "new" name for USL?  It's still the Ragin'
> Cajuns isn't it?  I lived in Lafayette from '84 to '90 (I'm married to a
> 'Bourque') and I even took a few EE classes at USL.  I saw quite a few
> football games at Cajun Field when Brian Mitchell was the QB there.
>
> It's a small world after all...  :-)
>
> Thanks for your time,
>
> Gary
> [EMAIL PROTECTED]
>
> The Web Depot, Inc.
> http://www.thewebdepot.com
>
> ----- Original Message -----
> From: "Duke Hillard" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, October 27, 2000 6:00 PM
> Subject: Re: [analog-help] Xferlog format question
>
> > Gary,
> >
> >     A simple idea that might be useful if you're on a UNIX box.
> > End-of-line is easily recognized by 'sed' in text substitutions.
> > If the completion status always appears at the end-of-line, you
> > could use 'sed' to convert the completion status to information
> > that analog does use (e.g., convert 'c' to '200' and 'i' to '404').
> > An analog wizard might have a better solution, though.
> >
> > -- Duke Hillard, Webmaster, UL Lafayette
> >
> >
> > Gary Kliethermes wrote:
> >
> > > Hello, I'm using Analog 4.11 to analyze the logs from an anonymous FTP
> > > server.  The FTP server (WU-FTP) uses the standard xferlog format.  I'm
> using
> > > the xferlog format as given in the /examples directory, which is:
> LOGFORMAT
> > > (%j %M %d %h:%n:%j %Y %t %S %b %r %j %j o %j %u ftp %j %j)
> > > LOGFORMAT (%j %j %j %j %j %j %j %j %j %j %j i%j) According to the docs
> on
> > > WU-FTP, the xferlog format consists of:current-time   transfer-time
> > > remote-host   file-size   filename   transfer-type   special-action-flag
> > > direction   access-mode   username   service-name
> authentication-method
> > > authenticated-user-id   completion-status Analog is working fine with
> the
> > > above LOGFORMAT except that it doesn't use the "completion-status"
> field.  The
> > > completion-status that's logged is either an "i" (incomplete) or a "c"
> > > (complete) which indicates if the requested file was successfully
> > > transferred. Here are a couple of examples from the xferlog file. Mon
> Oct 23
> > > 02:01:36 2000 344 someone.aol.com 1769585
> > > /home/audiotrack/ftp//activatedaudio.exe b _ o a IEUser@ ftp 0 * c
> > > Mon Oct 23 02:02:55 2000 243 someone.aol.com 73728
> > > /home/audiotrack/ftp//TerrisGarden_ActivatedAudio.mp3 b _ o a IEUser@
> ftp 0 *
> > > i The first line shows a successful transfer, while the second is a
> transfer
> > > that was incomplete for whatever reason.I need some way to determine the
> > > number of successful transfers.  Since the info I need is in the logfile
> there
> > > should be a way to use it, but I haven't found a way using Analog. Can
> Analog
> > > do this?  If not, does anyone know of any other reporting program that
> > > can? Thanks, [EMAIL PROTECTED] The Web Depot, Inc.
> > > http://www.thewebdepot.com
> >
begin:vcard 
n:Hillard;Duke
tel;work:337-482-5763
x-mozilla-html:TRUE
url:http://www.louisiana.edu/
org:University of Louisiana at Lafayette;University Computing Support Services
adr:;;P.O. Box 42770;Lafayette;LA;70504-2770;USA
version:2.1
email;internet:[EMAIL PROTECTED]
title:Computing Resources Coordinator
fn:Duke Hillard
end:vcard

Reply via email to