免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1756 | 回复: 3
打印 上一主题 下一主题

[proxy] squid日志如何保存到MS SQL数据库 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-03-08 13:05 |只看该作者 |倒序浏览
RT
squid日志如何直接保存到MS SQL数据库

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

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
2 [报告]
发表于 2014-03-08 14:29 |只看该作者
squid 本身 应该没这能力吧.

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

论坛徽章:
0
3 [报告]
发表于 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.

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
4 [报告]
发表于 2014-03-08 17:55 |只看该作者
skveen 发表于 2014-03-08 16:08
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 , 你搞定了记得说一下哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP