Goaccess is a very conscientious open source software, and its conscience lies in the following aspects:
1) Easy installation;
2) easy to operate;
3) the interface is cool;
Install goaccess is very simple, in CentOS directly #yum install goaccess, if the Yum source does not have goaccess, you can install Epel first. Here's how to install Epel:
wget Http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmwget http://rpms.famillecollet.com /ENTERPRISE/REMI-RELEASE-6.RPMRPM-UVH remi-release-6*.rpm epel-release-6*.rpm
After installing goaccess, we need to add the following words to the/etc/goaccess.conf:
Time-format%tdate-format%d/%b/%ylog-format%h%^[%d:%t%^] "%r"%s%b "%r" "%u"
After saving the exit, we can parse the Nginx log through goaccess, the statement format is very simple: "goaccess-f nginx Log absolute path." For example, my nginx log is Access-chen.log, look inside the content:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8B/8D/wKiom1hQ6C6hT7bsAAGzBzBtB0g094.png "title=" 1.png " alt= "Wkiom1hq6c6ht7bsaagzbzbtb0g094.png"/>
Although there are rules, it looks messy and requires two bottles of calming liquid before analyzing the logs.
Then I will be # goaccess-f Access-chen.log, I will see the following interface:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8B/8D/wKiom1hQ6JrAcXrmAAL9JsUK2ZQ956.png "title=" 1.png " alt= "Wkiom1hq6jracxrmaal9jsuk2zq956.png"/>
This look, the entire log looks more friendly, more straightforward, more tall. Enough to attract the envy of the people around him.
But there's still a point to note: goaccess default supported log format is the nginx default log format, that is, the following format in nginx.conf:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8B/89/wKioL1hQ6VqzLO6SAAAn3woXR_w837.png "title=" 1.png " alt= "Wkiol1hq6vqzlo6saaan3woxr_w837.png"/>
If your log format has changed and you don't want to change it back, you'll need to go to the corresponding log-format in/etc/goaccess.conf.
This is not finished, goaccess can also generate HTML, here # goaccess-f access-chen.log-a >/nginx installation path/html/chen.html. Then in the browser login to this server chen.html, you will see the entire log of the page layout,
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8B/8D/wKiom1hQ63mikRvwAAK-FUxCZzk521.png "title=" 1.png " alt= "Wkiom1hq63mikrvwaak-fuxczzk521.png"/>
In this way, we can send a copy of the day's log HTML to the operator's mailbox every day, so it is more convenient for us to analyze the log.
But the size of the goaccess is too coarse, can only be divided by the day, if you want to split by the hour, you need to grep out, this practice is less I understand ...
Reference: http://blog.maxhemby.se/determine-the-apache-traffic-load/#respond
This article is from "Life is waiting for Gordo" blog, please make sure to keep this source http://chenx1242.blog.51cto.com/10430133/1882643
Goaccess---Conscience log analysis tool