FTP日志文件的语法是什么

时间:2016-01-05 19:59:16

标签: logging ftp apache2

我正在尝试浏览一些FTP日志来检查我遇到过的问题。但是日志文件有一些简写标志,我不知道它们是什么意思,我无法找到任何类型的文档。

FTP日志中的一行示例是:

Tue Jan 05 17:18:22 2016 0 1.2.3.4 3581 /path/to/file/file.php a _ o r username ftp 1 * c

日期和时间很明显,1.2.3.4将是我的IP地址,3581我假设是Linux PID,username是我的FTP帐户用户名。

该行的结尾a _ o r username ftp 1 * cusernameftp除外)是我最困惑的。日期和我的IP地址之间的0

是否有关于所有这些标志代表什么的文件?

2 个答案:

答案 0 :(得分:0)

基于https://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/modules/ftp/ftp_log.c,您有以下特定于ftp的变量:

These callbacks extend mod_log_config by adding additional
% directives as follows:

%..M  The mode that was used to transfer the file.
      A single character is printed, a (ascii) or b (binary)
%..F  Any action that was taken on the file (concationated as needed)
        C - file was compressed.
        U - file was uncompressed.
        T - file was tarred.
        _ - no action taken.
%..d  Direction the file was sent.
        o - outgoing
        i - incoming
%..W  How the file was accessed.
        r - real
        a - anonymous
        g - guest
%..S    Service name, usually 'ftp'
%..Z    Authentication method
        0 - no auth
        1 - rfc931 auth
%..Y    Authenticated user id
        * - if not available

"正常"可以在此处找到Apache变量:https://httpd.apache.org/docs/2.4/mod/mod_log_config.html#formats

使用默认日志格式(基于https://httpd.apache.org/mod_ftp/ftp/ftp_tls.html

LogFormat "%{%b %e %H:%M:%S %Y}t %T %a %B %U %M %F %d %W %u %S %Z %Y" ftp_transfer

似乎是:

Date (%{%b %e %H:%M:%S %Y}t)
The time taken to serve the request, in seconds. (%T)
Client IP address of the request (%a)
Size of response in bytes, excluding HTTP headers. (%B)
The URL path requested, not including any query string. (%U)
The mode that was used to transfer the file, a=ascii, b=binary (%M)
Any action that was taken on the file (%F)
Direction the file was sento=outgoing, i=incoming  (%d)
How the file was accessed (%W)
username (%u)
Service name, usually 'ftp' (%S)
Authentication method 0=none, 1=rfc9321 (%Z)
Authenticated user id *=n/a (%Y)

答案 1 :(得分:0)

该日志行的格式似乎是xferlog(5)格式,传统上由许多FTP服务器使用。