goaccess时间和日志格式支持的参数:
CUSTOM LOG/DATE FORMAT
GoAccess can parse virtually
any web log format.
Predefined options include,
Common Log Format (CLF), Combined Log Format
(XLF/ELF), including
virtual host,
Amazon CloudFront (Download
Distribution), Google Cloud Storage and W3C format
(IIS).
GoAccess allows any custom
format string as well.
There are
two ways to configure the log format. The easiest
is to run GoAccess with -c to prompt a configuration window. Otherwise, it can be
configured under ~/.goaccessrc or the %sysconfdir%.
time_format
The time_format variable
followed by a space, specifies the log format time containing
any combination
of regular
characters and
special format specifiers. They
all begin with a percentage (%) sign. See‘man strftime‘. %T or
%H:%M:%S.
Note: If a timestamp is given
in microseconds, %f must be used as time_format
date_format
The date_format variable
followed by a space, specifies the log format date containing
any combination
of regular characters and
special format specifiers. They all begin with a percentage (%)
sign. See ‘man strftime‘. e.g.,
%Y-%m-%d.
Note: If a timestamp is given
in microseconds, %f must be used as date_format
log_format
The log_format variable
followed by a space or \t , specifies the log format
string.
%x
A date and time field matching the time_format
and date_format variables. This is used when a
timestamp
is given instead of the date
and time being in two separated variables.
%t
time field matching the time_format
variable.
%d
date field matching the date_format
variable.
%h
host (the client IP address, either IPv4 or
IPv6)
%r
The request
line from the
client. This
requires specific delimiters around the request
(as single
quotes, double quotes, or
anything else) to be parsable. If not, we have to use a combination
of special
format specifiers as %m %U
%H.
%q
The query string.
%m
The request method.
%U
The URL path requested.
Note: If
the query
string is in %U, there is no
need to use %q. However, if the URL path, does
not
include any query string, you
may use %q and the query string will be appended to the
request.
%H
The request protocol.
%s
The status code that the server sends back to
the client.
%b
The size of the object returned to the
client.
%R
The "Referrer" HTTP request header.
%u
The user-agent HTTP request header.
%D
The time taken to serve the request, in
microseconds as a decimal number.
%T
The time taken to serve the request, in seconds
with milliseconds resolution.
%L
The time taken to serve the request, in
milliseconds as a decimal number.
Note: If multiple time served
specifiers are used at the same time, the first option
specified in
the
format string will take
priority over the other specifiers.
%^
Ignore this field.
GoAccess requires the
following fields:
%h a valid IPv4/6
%d a valid date
%r the request