purftpd的日志格式举例

purftpd的4种日志格式对中文文件名的支持情况:
purftpd的4种日志格式分别是xferlog,w3c,stats,clf,之前使用时clf,类似apache日志格式的日志,但是其transfer.log中的中文名字无法正

常显示,尝试用iconv转码也不行,用file命令检查是ascii格式的:
root@233:/etc# file /var/log/pure-ftpd/info.log
/var/log/pure-ftpd/info.log: UTF-8 Unicode text
root@233:/etc# file /var/log/pure-ftpd/transfer.log
/var/log/pure-ftpd/transfer.log: ASCII text

purftpd支持的4种日志格式及举例:
1、xferlog:/var/log/pure-ftpd/transfer.log
Tue May 24 10:34:53 2011 0 192.168.1.200 12674 /data/ftp/test/解析.png b _ i r cpadmin ftp 1 * c


2、w3c:/var/log/pure-ftpd/transfer.log
2011-05-24 02:30:40 192.168.1.200 []created /data/ftp/test/%E5%88%B0%E5%85%AB%E4%B8%80%E5%AD%98%E5%82%A89Mbps.png 226 cpadmin

9679

3、stats:/var/log/pure-ftpd/transfer.log
1306204017 4ddb1755.1108 cpadmin 192.168.1.200 U 354501 1 /data/ftp/test/成功从底层开始.txt

使用purftpd自带的pure-statsdecode命令将transfer.log的时间戳转换为方便阅读的格式:
pure-statsdecode  /var/log/pure-ftpd/transfer.log
2011/05/24 10:26:57 4ddb1755.1108 cpadmin 192.168.1.200 U 354501 1 /data/ftp/test/成功从底层开始.txt

The Stats format is:
<date> <session id> <user> <ip> <U or D> <size> <duration> <file>
<date> is a GMT timestamp (time()) and <session id> identifies the current
session. <file> is unquoted, but it's always the last element of a log line.
"U" means "Upload" and "D" means "Download".
Warning: the session id is only designed for statistics purposes. While it's
always an unique string in the real world, it's theoretically possible to have
it non unique in very rare conditions. So don't rely on it for critical
missions.
A command called "pure-statsdecode" can be used to convert timestamps into
human-readable dates.

4、Apache-like
clf:/var/log/pure-ftpd/transfer.log
192.168.1.200 - cpadmin [24/May/2011:10:25:22 +0800] "PUT /data/ftp/test/%E6%88%90%E5%8A%9F%E4%BB%8E%E5%BA%95%E5%B1%82%E5%BC

%80%E5%A7%8B.txt" 200 354501

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值