简体   繁体   English

在.goaccessrc中定义特定的日志格式

[英]Define a specific log format in .goaccessrc

I'm reading the goaccess man page but I'm missing simple examples. 我正在阅读goaccess手册页,但缺少简单的示例。 I have a customised nginx with the following config: 我有一个具有以下配置的自定义nginx:

log_format timed_combined '$remote_addr - $remote_user [$time_local] '
    '$ssl_protocol/$ssl_cipher '
    '"$request" $status $body_bytes_sent '
    '"$http_referer" "$http_user_agent" '
    '$request_time $upstream_response_time $pipe';

Here is an example log entry: 这是一个示例日志条目:

66.249.76.120 - - [20/Dec/2016:19:04:03 +0100] 
TLSv1.2/ECDHE-RSA-AES128-GCM-SHA256 "GET / HTTP/1.1" 200 27232 
"-" "Mozilla/5.0 (compatible; Googlebot/2.1; 
+http://www.google.com/bot.html)" 0.026 0.026 .

How do I have to configure the .goaccessrc to read that format? 如何配置.goaccessrc以读取该格式?

You can add this to your config file or ~/.goaccessrc 您可以将其添加到配置文件或~/.goaccessrc

log-format %h %^[%d:%t %^] %^"%r" %s %b "%R" "%u" %T %^
date-format %d/%b/%Y
time-format %H:%M:%S

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM