# yum install -y ncurses-devel glib2-devel GeoIP-devel
# wget https://tar.goaccess.io/goaccess-1.3.tar.gz
# tar -xzvf goaccess-1.3.tar.gz
# cd goaccess-1.3/
# ./configure --enable-utf8 --enable-geoip=legacy
# make
# make install
vi /etc/goaccess.conf
# Apache/NGINX’s log formats below.
time-format %H:%M:%S
# Apache/NGINX’s log formats below.
date-format %d/%b/%Y
# NCSA Combined Log Format
log-format %h %^[%d:%t %^] “%r” %s %b “%R” “%u”
주석해제 !
# /usr/local/bin/goaccess -f /var/log/nginx/access.log
실행하면 터미널에서 실시간으로 로그 분석이 가능하다!
# /usr/local/bin/goaccess -f /var/log/nginx/access.log --log-format=COMBINED -o /usr/share/nginx/html/report.html
html파일 저장해서 그래픽으로 보는것도 가능하다.
'공부 > Linux' 카테고리의 다른 글
리눅스 시스템 모니터링 도구 (0) | 2020.02.19 |
---|---|
(CentOS 7) 셸 커맨드라인 로그 관리 (0) | 2020.02.19 |
(CentOS 7) rkhunter로 시스템 파일 변조 체크 (0) | 2020.02.19 |
(CentOS 7) Nginx 버전 정보 숨기기 (0) | 2020.02.19 |
(CentOS 7) firewalld 사용법 (0) | 2020.02.19 |