Top for NGINX

栏目: IT技术 · 发布时间: 4年前

内容简介:This tool is a rewrite ofFor those who have Rust installed, you can download it from

topngx

This tool is a rewrite of ngxtop to make it more easily installed and hopefully quicker. For those unfamiliar with the ngxtop, it is a tool that helps you parse NGINX access logs and print various statistics from them regardless of format. It is currently not feature complete with the original version but it should have enough functionality to be usable.

Installation

For those who have Rust installed, you can download it from crates.io :

cargo install topngx

Usage

topngx 0.1.0
Garrett Squire <github@garrettsquire.com>
top for NGINX

USAGE:
    topngx [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
    -h, --help         Prints help information
    -n, --no-follow    Do not tail the log file and only report what is currently there
    -V, --version      Prints version information

OPTIONS:
    -a, --access-log <access-log>    The access log to parse
    -f, --format <format>            The specific log format with which to parse [default: combined]
    -g, --group-by <group-by>        Group by this variable [default: request_path]
    -w, --having <having>            Having clause [default: 1]
    -t, --interval <interval>        Refresh the statistics using this interval which is given in seconds [default: 2]
    -l, --limit <limit>              The number of records to limit for each query [default: 10]
    -o, --order-by <order-by>        Order of output for the default queries [default: count]

SUBCOMMANDS:
    avg      Print the average of the given fields
    help     Prints this message or the help of the given subcommand(s)
    info     List the available fields as well as the access log and format being used
    print    Print out the supplied fields with the given limit
    query    Supply a custom query
    sum      Compute the sum of the given fields
    top      Find the top values for the given fields

Some example queries are:

# Run with the default queries and format (combined).
# Or use the --access-log and --no-follow flags if you do not want to read from standard input.
topngx < /path/to/access.log

# See the fields that you can use for queries.
topngx info

# Run a custom query.
# The fields passed in can be viewed via the info sub command.
topngx query -q 'select * from log where bytes_sent > 100' -f request_path bytes_sent < access.log

Limitations

The original version could tail log files in real time. Currently topngx can not do this but I am exploring options on how this can be done. Ideally I could use some implementation that is able to be Read from. There is also no option to filter the data but this could be added in the future. The original version allowed for automatic detection of NGINX configuration files, log file paths, and log format styles. topngx currently has command line options for these and may add this functionality in a later version.

If you find any other issues or features that may be missing, feel free to open an issue.

License

MIT

The ngxtop license can be seen here .


以上所述就是小编给大家介绍的《Top for NGINX》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

游戏改变世界

游戏改变世界

[美] 简•麦戈尼格尔(Jane McGonigal) / 闾佳 / 浙江人民出版社 / 2012-9 / 59.90元

◆《游戏改变世界》是著名未来学家、TED大会新锐演讲者简•麦戈尼格尔探索互联时代重要趋势的最新力作。在书中,作者指出:游戏可以弥补现实世界的不足和缺陷,游戏化可以让现实变得更美好。 ◆作者在书中用大量事例告诉我们,游戏击中了人类幸福的核心,提供了令人愉悦的奖励、刺激性的挑战和宏大的胜利,而这些都是现实世界十分匮乏的。她的研究表明,我们可以借助游戏的力量,让生活变得像游戏一样精彩。 ◆作......一起来看看 《游戏改变世界》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具