{"id":13393791,"url":"https://github.com/lebinh/ngxtop","last_synced_at":"2025-04-29T18:59:29.139Z","repository":{"id":15255555,"uuid":"17984636","full_name":"lebinh/ngxtop","owner":"lebinh","description":"Real-time metrics for nginx server","archived":false,"fork":false,"pushed_at":"2022-10-06T19:58:56.000Z","size":43,"stargazers_count":6499,"open_issues_count":63,"forks_count":473,"subscribers_count":211,"default_branch":"master","last_synced_at":"2025-04-29T18:59:25.106Z","etag":null,"topics":["cli","monitoring","nginx"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"messibbb/Hussein","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lebinh.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-21T15:39:52.000Z","updated_at":"2025-04-29T01:47:25.000Z","dependencies_parsed_at":"2022-07-30T20:18:15.700Z","dependency_job_id":null,"html_url":"https://github.com/lebinh/ngxtop","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebinh%2Fngxtop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebinh%2Fngxtop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebinh%2Fngxtop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebinh%2Fngxtop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lebinh","download_url":"https://codeload.github.com/lebinh/ngxtop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251565802,"owners_count":21609979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","monitoring","nginx"],"created_at":"2024-07-30T17:01:00.291Z","updated_at":"2025-04-29T18:59:29.120Z","avatar_url":"https://github.com/lebinh.png","language":"Python","readme":"================================================================\n``ngxtop`` - **real-time** metrics for nginx server (and others)\n================================================================\n\n**ngxtop** parses your nginx access log and outputs useful, ``top``-like, metrics of your nginx server.\nSo you can tell what is happening with your server in real-time.\n\n    ``ngxtop`` is designed to run in a short-period time just like the ``top`` command for troubleshooting and monitoring\n    your Nginx server at the moment. If you need a long running monitoring process or storing your webserver stats in external\n    monitoring / graphing system, you can try `Luameter \u003chttps://luameter.com\u003e`_.\n\n``ngxtop`` tries to determine the correct location and format of nginx access log file by default, so you can just run\n``ngxtop`` and having a close look at all requests coming to your nginx server. But it does not limit you to nginx\nand the default top view. ``ngxtop`` is flexible enough for you to configure and change most of its behaviours.\nYou can query for different things, specify your log and format, even parse remote Apache common access log with ease.\nSee sample usages below for some ideas about what you can do with it.\n\nInstallation\n------------\n\n::\n\n    pip install ngxtop\n\n\nNote: ``ngxtop`` is primarily developed and tested with python2 but also supports python3.\n\nUsage\n-----\n\n::\n\n    Usage:\n        ngxtop [options]\n        ngxtop [options] (print|top|avg|sum) \u003cvar\u003e\n        ngxtop info\n\n    Options:\n        -l \u003cfile\u003e, --access-log \u003cfile\u003e  access log file to parse.\n        -f \u003cformat\u003e, --log-format \u003cformat\u003e  log format as specify in log_format directive.\n        --no-follow  ngxtop default behavior is to ignore current lines in log\n                         and only watch for new lines as they are written to the access log.\n                         Use this flag to tell ngxtop to process the current content of the access log instead.\n        -t \u003cseconds\u003e, --interval \u003cseconds\u003e  report interval when running in follow mode [default: 2.0]\n\n        -g \u003cvar\u003e, --group-by \u003cvar\u003e  group by variable [default: request_path]\n        -w \u003cvar\u003e, --having \u003cexpr\u003e  having clause [default: 1]\n        -o \u003cvar\u003e, --order-by \u003cvar\u003e  order of output for default query [default: count]\n        -n \u003cnumber\u003e, --limit \u003cnumber\u003e  limit the number of records included in report for top command [default: 10]\n        -a \u003cexp\u003e ..., --a \u003cexp\u003e ...  add exp (must be aggregation exp: sum, avg, min, max, etc.) into output\n\n        -v, --verbose  more verbose output\n        -d, --debug  print every line and parsed record\n        -h, --help  print this help message.\n        --version  print version information.\n\n        Advanced / experimental options:\n        -c \u003cfile\u003e, --config \u003cfile\u003e  allow ngxtop to parse nginx config file for log format and location.\n        -i \u003cfilter-expression\u003e, --filter \u003cfilter-expression\u003e  filter in, records satisfied given expression are processed.\n        -p \u003cfilter-expression\u003e, --pre-filter \u003cfilter-expression\u003e in-filter expression to check in pre-parsing phase.\n\nSamples\n-------\n\nDefault output\n~~~~~~~~~~~~~~\n\n::\n\n    $ ngxtop\n    running for 411 seconds, 64332 records processed: 156.60 req/sec\n\n    Summary:\n    |   count |   avg_bytes_sent |   2xx |   3xx |   4xx |   5xx |\n    |---------+------------------+-------+-------+-------+-------|\n    |   64332 |         2775.251 | 61262 |  2994 |    71 |     5 |\n\n    Detailed:\n    | request_path                             |   count |   avg_bytes_sent |   2xx |   3xx |   4xx |   5xx |\n    |------------------------------------------+---------+------------------+-------+-------+-------+-------|\n    | /abc/xyz/xxxx                            |   20946 |          434.693 | 20935 |     0 |    11 |     0 |\n    | /xxxxx.json                              |    5633 |         1483.723 |  5633 |     0 |     0 |     0 |\n    | /xxxxx/xxx/xxxxxxxxxxxxx                 |    3629 |         6835.499 |  3626 |     0 |     3 |     0 |\n    | /xxxxx/xxx/xxxxxxxx                      |    3627 |        15971.885 |  3623 |     0 |     4 |     0 |\n    | /xxxxx/xxx/xxxxxxx                       |    3624 |         7830.236 |  3621 |     0 |     3 |     0 |\n    | /static/js/minified/utils.min.js         |    3031 |         1781.155 |  2104 |   927 |     0 |     0 |\n    | /static/js/minified/xxxxxxx.min.v1.js    |    2889 |         2210.235 |  2068 |   821 |     0 |     0 |\n    | /static/tracking/js/xxxxxxxx.js          |    2594 |         1325.681 |  1927 |   667 |     0 |     0 |\n    | /xxxxx/xxx.html                          |    2521 |          573.597 |  2520 |     0 |     1 |     0 |\n    | /xxxxx/xxxx.json                         |    1840 |          800.542 |  1839 |     0 |     1 |     0 |\n\nView top source IPs of clients\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    $ ngxtop top remote_addr\n    running for 20 seconds, 3215 records processed: 159.62 req/sec\n\n    top remote_addr\n    | remote_addr     |   count |\n    |-----------------+---------|\n    | 118.173.177.161 |      20 |\n    | 110.78.145.3    |      16 |\n    | 171.7.153.7     |      16 |\n    | 180.183.67.155  |      16 |\n    | 183.89.65.9     |      16 |\n    | 202.28.182.5    |      16 |\n    | 1.47.170.12     |      15 |\n    | 119.46.184.2    |      15 |\n    | 125.26.135.219  |      15 |\n    | 125.26.213.203  |      15 |\n\nList 4xx or 5xx responses together with HTTP referer\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    $ ngxtop -i 'status \u003e= 400' print request status http_referer\n    running for 2 seconds, 28 records processed: 13.95 req/sec\n\n    request, status, http_referer:\n    | request   |   status | http_referer   |\n    |-----------+----------+----------------|\n    | -         |      400 | -              |\n\nParse apache log from remote server with `common` format\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    $ ssh user@remote_server tail -f /var/log/apache2/access.log | ngxtop -f common\n    running for 20 seconds, 1068 records processed: 53.01 req/sec\n\n    Summary:\n    |   count |   avg_bytes_sent |   2xx |   3xx |   4xx |   5xx |\n    |---------+------------------+-------+-------+-------+-------|\n    |    1068 |        28026.763 |  1029 |    20 |    19 |     0 |\n\n    Detailed:\n    | request_path                             |   count |   avg_bytes_sent |   2xx |   3xx |   4xx |   5xx |\n    |------------------------------------------+---------+------------------+-------+-------+-------+-------|\n    | /xxxxxxxxxx                              |     199 |        55150.402 |   199 |     0 |     0 |     0 |\n    | /xxxxxxxx/xxxxx                          |     167 |        47591.826 |   167 |     0 |     0 |     0 |\n    | /xxxxxxxxxxxxx/xxxxxx                    |      25 |         7432.200 |    25 |     0 |     0 |     0 |\n    | /xxxx/xxxxx/x/xxxxxxxxxxxxx/xxxxxxx      |      22 |          698.727 |    22 |     0 |     0 |     0 |\n    | /xxxx/xxxxx/x/xxxxxxxxxxxxx/xxxxxx       |      19 |         7431.632 |    19 |     0 |     0 |     0 |\n    | /xxxxx/xxxxx/                            |      18 |         7840.889 |    18 |     0 |     0 |     0 |\n    | /xxxxxxxx/xxxxxxxxxxxxxxxxx              |      15 |         7356.000 |    15 |     0 |     0 |     0 |\n    | /xxxxxxxxxxx/xxxxxxxx                    |      15 |         9978.800 |    15 |     0 |     0 |     0 |\n    | /xxxxx/                                  |      14 |            0.000 |     0 |    14 |     0 |     0 |\n    | /xxxxxxxxxx/xxxxxxxx/xxxxx               |      13 |        20530.154 |    13 |     0 |     0 |     0 |\n\n","funding_links":[],"categories":["System administration","Python","Install from Source","Libraries","Misc","Third Modules","Linux System Tools","Tools","Monitoring","Linux生态圈Dev\u0026Ops工具与服务"],"sub_categories":["Monitoring","C Modules","Log Analysis","Lua Modules"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flebinh%2Fngxtop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flebinh%2Fngxtop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flebinh%2Fngxtop/lists"}