[thelist] Combining Apache Server Logs

Ronald W. Dorman rwd at csi1st.net
Fri May 26 13:34:42 2000


Dan, I had looked at doing that but, this method will not get the data into
the combined log in the proper format.  I already have the changes in Apache
and the virthost definitions and have been capturing data for last few days
for testing.  A record in the new combined file has several pieces of the pie
in a certain order in the record.  'Cat'ing the files together does not
provide this formatting (positioning) within the record and does not provide
seperators/quotes where needed.

This is a question I asked the vendor and thier response
    > Do you have, or can you point me to, any scripts to merge separate
    > logs from Apache Web Server on Linux to combined log on Apache Web
    > Server on Linux?

    Sorry, I'm not aware of such scripts. It's not particularly hard
    to do with Perl.

Looks like I will be improving my Perl skills.

Thanks much.


"Daniel J. Cody" wrote:

> Ron -
>
> Try something like:(lets assume you have access.log, referer.log and
> agent.log in a directory)
>
> cat *.log > combined.log
>
> or you add them one at a time to eachother:
>
> cat access.log >> referer.log
> cat agent.log >> referer.log
>
> That will append access and agent to referer.
>
> Once you've done this, you can set combined logs in your httpd.conf file
> by turning on the customlog directive:
>
> CustomLog /usr/local/apache/logs/access_log combined
>
> and then in your <virtual hosts>(or whatever you're using):
>
> CustomLog /home/djc/access.log combined
>
> will make a file called access.log that has all three log
> parameters..(if it only has two, look for a line that might have --
> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
> -- and edit that.)
>
> Shout if you have any more questions..
>
> .djc.
>
> "Ronald W. Dorman" wrote:
> >
> > We are going to begin using a new site statistics package that utilizes
> > a combined log format to analyze information for site access statistical
> > reporting.  The old package used separate logs for 'common', 'agent' and
> > 'referrer' information.  We need to get the data from the old (separate)
> > logs into the new (combined) log.  Does anyone have a script, or know
> > where we might find one that will do this task.  We are using Red Hat
> > Linux 6.1 and Apache Web Server.   Thanks.
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !

--
Ron Dorman
CSI, Inc.
804-369-5466
804-309-1494 fax
877-274-3477 toll free
http://www.csi1st.net
mailto:rwd@csi1st.net