ログ解析ツールGoAcessの使用


  :http://www.cnblogs.com/yjf512/p/3640346.html

      GoAcess   
1.       EPEL   
1.1    yum 
mv /etc/yum.repos.d/epel.repo/etc/yum.repos.d/epel.repo.backup 
mv /etc/yum.repos.d/epel-testing.repo/etc/yum.repos.d/epel-testing.repo.backup
 
1.2       aliyun YUMepel 
epel(RHEL 7)
wget -O/etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
 
epel(RHEL 6)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
 
yum clean all
yum makecache
2.  GoAcess
       sudo yuminstall goaccess
       
3 .   GoAccess
GoAccess       ,              。
            10  12  IP       ,             。
        html        。
                               ,         。
3.1.      
goaccess   :
-f  :          
-a --agent-list :  host        IP    IP user-agentlist
-c --conf-dialog:     log format      
-d --with-output-resolver  HTML    json     IP   
     -d,goaccess    GEOIP   IP  。
-e --exclude-ip=
Host          IP,        IP   
-h --help     
-H --http-protocol          HTTP    
-m --with-mouse             ,   m  ,             
-M --http-method     HTTP    
-o --output-format=csv|json    csv  json  
-p --conf-file=
      ,        ,           log-format date,            format    。         ,    ~/.goace***c。
-q --no-query-string
         
-r --no-term-resolver
 Host       IP   。  -r   IP  。
--no-color
       
--real-os
         。 Operation System   ,              。
 
3.1.1              :
F1       
F5       
q       ,      
o       
0-9      
tab shift+tab          
j k          
s           
 
3.2   GoAccess    
               
vim ~/.goacce***c
 
time-format%H:%M:%S
 
date-format%d/%b/%Y
 
log-format %h%^[%d:%t %^] "%r" %s %b "%R" "%u"
 
       nginx          ,       ,    
 
  GoAccess          html ,             。
        html  :
goaccess -d -f web.log -a -p ~/.goacce***c> log.html
 
   html