skveen 发表于 2014-03-08 13:05

squid日志如何保存到MS SQL数据库

RT
squid日志如何直接保存到MS SQL数据库

参考信息是:
Your Perl installation must have database bindings to connect to
ms-sql via the Perl DBI module.

q1208c 发表于 2014-03-08 14:29

squid 本身 应该没这能力吧.

另外, 楼主给的信息更奇怪, 怎么象是在考大家呢. :em17:

skveen 发表于 2014-03-08 16:08

哈哈,

这个信息是我问squid maililst时一个牛人给我说的。但我一直没有做到
他的全部回复如下:

Set these in squid.conf:
logfile_daemon /usr/local/squid/libexec/log_db_daemon
access_log daemon:/host/database/table/username/password


** Replace "/host/database/table/username/password" above with the
details for your ms-sql server. Leaving the / characters between each
detail.

** Your Perl installation must have database bindings to connect to
ms-sql via the Perl DBI module.

** the log database must exist before the helper is run. Log table is
optional.

** Helper requires a login with SELECT,INSERT,CREATE privileges.

The DB helper will attempt to create the logging table with required
fields if none exists assuming the helper login has CREATE privileges to
the database.

If you do not want to give it CREATE privileges for any reason, you can
run the helper manually with the single command line option
"/host/database/table/username/password" using a login details which do
have CREATE privileges. The Squid login will then only need
SELECt,INSERT privileges.

q1208c 发表于 2014-03-08 17:55

skveen 发表于 2014-03-08 16:08 static/image/common/back.gif
Set these in squid.conf:
logfile_daemon /usr/local/squid/libexec/log_db_daemon
access_log daemon:/host/database/table/username/password


他的意思是说, squid 带了一个 log_db_daemon 的程序, 可以帮你把log写进 database
看这意思, 这个 log_db_daemon 是用perl写的.
所以, 他告诉你, 必须保证 perl DBI 能够正常访问你的 database. 也就是说 perl perl-dbi perl-DBD-mssql 都要安装好.

下面一行就是数据库的配置了. 我手上没有squid, 更没有ms sql , 你搞定了记得说一下哈 :)
页: [1]
查看完整版本: squid日志如何保存到MS SQL数据库