语法如下:
1、ngxtop [options]
2、ngxtop [options](备注:参数) (print|top|avg|sum)(备注:内含的4个关键词) <var>(备注:所要使用的变量:其中ngxtop内置的变量有bodybytessend,http_referer,httpuseragent,remote_addr,remote_user,request,status,time_local)
其中print 表示自定义显示的变量信息,如:ngxtop print remote_addr status http_referer(表示只实时输出显示,remote_addr(表示客户端请求IP),status等信息)
top 表示
3、ngxtop info
所对应的可选参数分别如下所示:
Options:
-l <file>, --access-log <file> access log file to parse.
-f <format>, --log-format <format> log format as specify in log_format directive.
--no-follow ngxtop default behavior is to ignore current lines in log
and only watch for new lines as they are written to the access log.
Use this flag to tell ngxtop to process the current content of the access log instead.
-t <seconds>, --interval <seconds> report interval when running in follow mode [default: 2.0]
-g <var>, --group-by <var> group by variable [default: request_path]
-w <var>, --having <expr> having clause [default: 1]
-o <var>, --order-by <var> order of output for default query [default: count]
-n <number>, --limit <number> limit the number of records included in report for top command [default: 10]
-a <exp> ..., --a <exp> ... add exp (must be aggregation exp: sum, avg, min, max, etc.) into output
-v, --verbose more verbose output
-d, --debug print every line and parsed record
-h, --help print this help message.
--version print version information.
Advanced / experimental options:
-c <file>, --config <file> allow ngxtop to parse nginx config file for log format and location.
-i <filter-expression>, --filter <filter-expression> filter in, records satisfied given expression are processed.
-p <filter-expression>, --pre-filter <filter-expression> in-filter expression to check in pre-parsing phase.