https://github.com/dmuth/nginxtop
UNIX top-like app for nginx (or Apache, if you wish) access logs.
https://github.com/dmuth/nginxtop
Last synced: about 1 year ago
JSON representation
UNIX top-like app for nginx (or Apache, if you wish) access logs.
- Host: GitHub
- URL: https://github.com/dmuth/nginxtop
- Owner: dmuth
- Created: 2014-05-03T22:03:56.000Z (about 12 years ago)
- Default Branch: main
- Last Pushed: 2020-09-03T22:22:00.000Z (almost 6 years ago)
- Last Synced: 2024-05-02T06:07:36.832Z (about 2 years ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 14
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nginxtop
UNIX top-like app for nginx (or Apache, if you wish) access logs.
Every so often, a poorly behaved spammer or web crawler will hit one of the websites
I manage, and proceed to load the same pages over and over, causing a resource issue
and possibly even a Denial of Service. I got tired of this, so I built my own tool to determine
in real time who the culrprits were.
## Installation
### Via npm (recommended)
npm install -g nginxtop
This will install nginxtop into /usr/local/bin/ or somewhere else likely to be in your path.
### From source
git@github.com:dmuth/nginxtop.git
cd nginxtop
This will check out a copy of the nginxtop app to your current directory.
## Usage
tail -f /var/log/nginx/access.log | nginxtop [ -n num_hosts_to_print] [-i report_interval_in_seconds]
## Testing
There is a file called `test.log` in this directory. It contains sample log entries. To test nginxtop using it:
tail -fn100 test.log | nginxtop -n 5
You'll start to see output like this once every second:
Nginxtop Top Hosts
===========================================
127.0.0.10: 14 hits
127.0.0.1: 7 hits
127.0.0.2: 6 hits
127.0.0.3: 6 hits
127.0.0.4: 5 hits
## Where to find this
- [https://bitbucket.org/dmuth/nginxtop](https://bitbucket.org/dmuth/nginxtop)
- [https://github.com/dmuth/nginxtop](https://github.com/dmuth/nginxtop)
### Feedback
Have feedback? Want to report bugs?
Hit me up via email (doug.muth@gmail.com) or via many other methods listed at:
[http://www.dmuth.org/contact](http://www.dmuth.org/contact)
Enjoy!