国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

采用ngxtop實現nginx實時訪問數據統計

2024-08-30 12:26:59
字體:
來源:轉載
供稿:網友

對于nginx的實時訪問數據統計可采用ngxtop實現監控web server的訪問情況 。ngxtop 允許你對 NGINX 的訪問日志 (access log) 進行實時解析, 并輸出類似 top 的有用信息。

ngxtop 是 python 腳本安裝包,需要python支持。

對于python的包和庫文件我們一般喜歡pip管理,沒有安裝的可以:

wget https://raw.github.com/pypa/pip/master/contrib/get-pip.pypython get-pip.py #安裝pip python包管理工具pip install ngxtop #下載安裝ngxtop

使用:

ngxtop -l /usr/local/nginx/logs/access.log

顯示請求最多的ip和request

ngxtop -t 1 -l /var/log/nginx/access.log top remote_addr request

使用幫助:

Usage:  ngxtop [options]  ngxtop [options] (print|top|avg|sum) <var>  ngxtop infoOptions:  -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.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 襄汾县| 桂东县| 桃园县| 宾阳县| 温宿县| 道孚县| 平潭县| 江安县| 五台县| 信丰县| 陆河县| 南充市| 冷水江市| 博罗县| 黔江区| 清涧县| 新竹市| 广州市| 正蓝旗| 大安市| 淳安县| 房产| 鱼台县| 苏尼特右旗| 光泽县| 华坪县| 正宁县| 中阳县| 原平市| 大兴区| 康马县| 马山县| 农安县| 皮山县| 资溪县| 长丰县| 金湖县| 晋城| 杭锦旗| 吉木萨尔县| 翁源县|