An interesting Apache Log to MySql ?
| From: | Dave Carrera | Date: | Sat, 29 Mar 2003 14:25:15 +0000 |
| Subject: | An interesting Apache Log to MySql ? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26699@lists.php.net to get a copy of this message | ||
Hi All
I have been trying to find a way to write Apache Log data to a MySql db
via a pipe log directive.
So far I have this:
LogFormat "%v:*:%B:*:%u:*:%f:*:%h:*:%a:*:%s:*:%{%Y-%m-%d
%H:%M:%S%z}t:*:%{Content-type:}o:*:%U:*:%{Referer}i:*:%{User-Agent}i:*:%
{cookie}n" mysqllog
As my Logformat directive. It is delimited by ":*:".
Now the log part I am having problems with.
CustomLog "|/usr/local/bin/php phplog.php" mysqllog
I was thinking that I should write in the phplog.php all the connection
stuff and load Logformat data in to it but I don’t know where or how to
get the data. I don’t want to write the log file then read it in as that
defeats the object I am looking to do.
I don’t want to use mod_sql thing as I am not allowed to compile new
modules.
So I think I am asking what do I put into this:
$loaddata = mysql_query("insert into table .......")
To load the data from LogFormat.
If you can advise or help with this I will be most thank full.
Dave C
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 17/03/2003