The interview will be Beimian to the problem is: give the Web server access log, please write a script to statistics access to the top 10 IP? What are the top 10 requests for access? When you get to know the goaccess, you'll understand that the only thing that can be done is to put a or C in addition to the ability to memorize your scripts.
For nginx log analysis, there are many tools, measuring the standard of good or bad is probably three fast: Install fast, parse fast, start fast. Meeting these three points of goaccess is indeed the home of the necessary medicine.
In fact, the title is a bit wronged goaccess, it is a log analysis tool, not just for nginx use. You can also use it to analyze Apache,iis logs, or even Web services you write yourself, assuming that you need to define a good log format for parsing. If you see a beautiful woman, you will look like a few of its functions are:
1 parsing speed is fast
2 Easy to use
3 can generate Html,json,csv installation goaccess
If you are CentOS, use Yum:
Yum Install goaccess
If your yum can't find goaccess, install Epel first.
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com /enterprise/remi-release-6.rpm sudo rpm-uvh remi-release-6*.rpm epel-release-6*.rpm
There are two ways to use goaccess, one that is displayed and manipulated directly on the console.
When you want to immediately analyze the IP access situation at 10 to 12 this morning, it's fastest to hit the console directly.
Another is to generate HTML files or data files.
If you want to manage the server cluster every day to send you a visit to the log yesterday, this is not the second choice.
Console uses goaccess
Parameters for Goaccess:
-F <input-file>: Log files that need to be resolved
-A--agent-list: In the host module is not able to click IP to appear this IP user-agentlist, is to appear as a function of the diagram
-C--conf-dialog: whether to display the log and Format Configuration dialog window.
This is the window below.