httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff White" <jlw...@earthlink.net>
Subject Re: [users@httpd] Apache logging
Date Sat, 12 Feb 2005 18:57:11 GMT

From: Nick Kirby

> LogFormat "%h %t \"%r\" %>s %b"

> Ideally I'd split the date from
> the time, but I can work on that.

Read on.

> What I want to do is send this
> into an access database.

From: "Jorge Schrauwen"

>
> if you want to put it in an access database.
> id recommend writing your own application
> that read the log and then add's the content
> to the access database, then clears the log.
>

No need to write anything, except
the query, with Microsoft's free
Log Parser 2.2 tool.

<quote>

The SQL output format uploads
output records to a table in
a SQL database.

This output format can upload
records to a table in any
ODBC-compliant database,
including Microsoft SQL Server
and Microsoft Access databases.

When the target table does not
already exist in the specified
database, the SQL output format
creates a table with as many
columns as the number of fields in
the SELECT clause of the query.

</quote>

Log Parser 2.2 will read the Apache log

<quote>

New in 2.2 - The NCSA input format now
parses also combined and extended
NCSA log files.

</quote>

and after reading the Apache log,
Log Parser will stick the output right
into your Access database or any
ODBC-compliant database.

For your

IP, Time, Request, Status, Size

something like

LogParser "Select RemoteHostName,
DateTime, Request, StatusCode,
BytesSent INTO MyTable FROM access.log"
-i:NCSA -o:SQL
-oConnString:"Driver={Microsoft Access Driver (*.mdb)};
Dbq=C:\MyDB\MyDB.mdb;Uid=MyUsername;Pwd=MyPassword"

All the above in one long line
in the command prompt or in
a file for Log Parser to use.

LogParser -i:[OPTIONS] file:Myquery.sql

or

LogParser file:myquery.sql?param1=value1+param2=value2"

Also check out sending the output to
custom-formatted HTML reports, and
formatted charts for the boss.

And for your splitting date and time
do something in your query like

TO_STRING(DateTime, 'MMM dd yyyy') as Date,
TO_STRING(DateTime, 'hh:mm:ss') as Time,

> to the access database, then clears the log.

No need to clear the log either

<quote>

Log Parser offers a feature that
allows sequential executions of
the same query to only process
new data that has been logged
since the last execution. This
feature can be enabled with the
iCheckPoint parameter of the
input format.

</quote>

To get Log Parser 2.2

<quote>

Log parser is a powerful, versatile
tool that provides universal query
access to text-based data such as
log files, XML files and CSV files,
as well as key data sources on the
Windows operating system such as
the Event Log, the Registry, the file
system, and Active Directory.

Snip

Most software is designed to
accomplish a limited numer of
specific tasks. Log Parser is
different... the number of ways
it can be used is limited only
by the needs and imagination of
the user. The world is your
database with Log Parser.

</quote>

Download details: Log Parser 2.2
http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&DisplayLang=en

And for more Log Parser information

MSN Search
http://search.msn.com


Jeff



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message