0

我有一个 nginx 自定义日志文件,如下所示:

{ "timestamp": "2015-12-20T12:30:40+03:30", "remote_addr": "80.253.148.194", "remote_user": "-", "body_bytes_sent": "0", "request_time": "0.000", "status": "304", "request": "GET /repository/9/13350-000036.png HTTP/1.1", "request_method": "GET", "http_referrer": "http://domain.ltd/profile/category/1425", "http_user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0" } { "timestamp": "2015-12-20T12:30:40+03:30", "remote_addr": "80.253.148.194", "remote_user": "-", "body_bytes_sent": "0", "request_time": "0.000", "status": "304", "request": "GET /repository/9/13349-000018.png HTTP/1.1", "request_method": "GET", "http_referrer": "http://domain.ltd/profile/category/1425", "http_user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0" } { "timestamp": "2015-12-20T12:27:24+03:30", "remote_addr": "79.175.174.23", "remote_user": "-", "body_bytes_sent": "139008", "request_time": "0.298", "status": "206", "request": "GET /repository/9/56766da1202f7.mp4 HTTP/1.1", "request_method": "GET", "http_referrer": "-", "http_user_agent": "Lavf/56.4.101" }...

它由 3792061 行组成。

我已经设置了日志格式并且它工作正常,但是在工作完成后有一些数据丢失,就像报告中没有/9/文件一样。 这是我的goaccess报告。

我的命令是: # goaccess -o json --static-file=.mp4 --static-file=.MP4 --ignore-panel=VISITORS --ignore-panel=REQUESTS --ignore-panel=NOT_FOUND --ignore-panel=HOSTS --ignore-panel=OS --ignore-panel=BROWSERS --ignore-panel=VISIT_TIMES --ignore-panel=VIRTUAL_HOSTS --ignore-panel=REFERRERS --ignore-panel=REFERRING_SITES --ignore-panel=KEYPHRASES --ignore-panel=GEO_LOCATION --ignore-panel=STATUS_CODES --sort-panel=REQUESTS_STATIC,BY_BW,DESC --debug-file debug.log --invalid-requests invalid.log -f ./access.json > data.json

无效请求文件有 40 行,可忽略。

但后来我拆分了我的文件并找到了其中的/9/# cat access.json | fgrep '/9/' ./access.json > newlog.json

我在 goaccess 中为此日志执行完全相同的命令,我得到这个输出很好。

被困在那里,任何帮助表示赞赏

4

1 回答 1

2

它只显示前 366 个项目。

每个活动窗口共有 366 个项目。最终这将是可定制的。默认情况下,这 366 项都在 CSV 和 JSON 导出中可用,并且作为 HTML 报告中的可展开面板(右上角)。

http://goaccess.io/man#notes

于 2016-01-20T17:37:23.613 回答