lebinh/ngxtop

ngxtop reports no ips or data from nginx log ?

centminmod opened this issue · 2 comments

ngxtop latest version installed via pip on CentOS 6.6 64bit

ngxtop --version
xstat 0.1

command used

ngxtop -l /home/nginx/domains/domain.com/log/access.log.norotate --group-by remote_addr --no-follow

results in output of

running for 0 seconds, 0 records processed: 0.00 req/sec

Summary:
|   count |   avg_bytes_sent |   2xx |   3xx |   4xx |   5xx |
|---------+------------------+-------+-------+-------+-------|
|       0 |                  |     0 |     0 |     0 |     0 |

Detailed:
| remote_addr   | count   | avg_bytes_sent   | 2xx   | 3xx   | 4xx   | 5xx   |
|---------------+---------+------------------+-------+-------+-------+-------|

log file contents only 5 lines of

 IPADDRESS - - [14/Jun/2015:00:52:57 +0000] GET /url HTTP/1.1 "200" 31 "-" "curl/7.29.0" "-" "-" "8" "1" "0.000"

same problem if the nginx log format is customized

i.e.

164.132.201.51 - - [15/Nov/2016:06:03:21 +0000] "PROPFIND /webdav/ HTTP/1.1" 405 166 "-" "WEBDAV Client" "-" rt=0.000 ua="-" us="-" ut="-" ul="-" cs=-

the nginx log format used is one that nginx amplify recommends

log_format  main_ext '$remote_addr - $remote_user [$time_local] "$request" '
                         '$status $body_bytes_sent "$http_referer" '
                         '"$http_user_agent" "$http_x_forwarded_for" '
                         'rt=$request_time ua="$upstream_addr" '
                         'us="$upstream_status" ut="$upstream_response_time" '
                         'ul="$upstream_response_length" '
                         'cs=$upstream_cache_status' ;

Same issue happening for me.