본문 바로가기

분석/Go Access

GoAccess 1.3 설치 - Homebrew 이용

goaccess 설치

$ brew install goaccess
==> Installing dependencies for goaccess: libmaxminddb and tokyo-cabinet
==> Installing goaccess dependency: libmaxminddb
==> Downloading https://homebrew.bintray.com/bottles/libmaxminddb-1.3.2.mojave.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring libmaxminddb-1.3.2.mojave.bottle.1.tar.gz
🍺  /usr/local/Cellar/libmaxminddb/1.3.2: 31 files, 154.4KB
==> Installing goaccess dependency: tokyo-cabinet
==> Downloading https://homebrew.bintray.com/bottles/tokyo-cabinet-1.4.48.mojave.bottle.1.tar.gz
==> Downloading from https://akamai.bintray.com/dd/dd723c7394954fe354044bbd6bbea955e985c4652f0d2e7e9a7696da87d7a3aa?__gda__=exp=1568
######################################################################## 100.0%
==> Pouring tokyo-cabinet-1.4.48.mojave.bottle.1.tar.gz
🍺  /usr/local/Cellar/tokyo-cabinet/1.4.48: 80 files, 4MB
==> Installing goaccess
==> Downloading https://homebrew.bintray.com/bottles/goaccess-1.3_1.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/1e/1e6c45b187083c3e39a477309439cfec74e8a255ac83e7f444d26fb707f0654f?__gda__=exp=1568
######################################################################## 100.0%
==> Pouring goaccess-1.3_1.mojave.bottle.tar.gz

 

conf 파일 수정

$ vi /usr/local/etc/goaccess/goaccess.conf

log-format %h %^ %^ %d:%t %^ %^ "%r" %s %b "%R" "%u"
date-format %d/%b/%Y
time-format %H:%M:%S
output-format html

 

분석 실행

$ goaccess ./accessLog201909042104.txt > ./accessLog201909042104.html
Warning: Failed to set locale category LC_NUMERIC to en_KR.
Warning: Failed to set locale category LC_TIME to en_KR.
Warning: Failed to set locale category LC_COLLATE to en_KR.
Warning: Failed to set locale category LC_MONETARY to en_KR.
Warning: Failed to set locale category LC_MESSAGES to en_KR.
Parsing... [0] [0/s]
GoAccess - version 1.3 - Jun 17 2019 02:48:47
Config file: No config file used

Fatal error has occurred
Error occurred at: src/parser.c - parse_log - 2764
No time format was found on your conf file.

 

명령 실행 시 형식을 옵션으로 넣어서 실행

$ goaccess --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format='%h - - %d:%^ %^ %T "%r" %s %b "%R" "%u"' -f ./accessLog201909042104.txt

Parsed 1 linesproducing the following errors:
Token '04/Sep/2019' doesn't match specifier '%d'
Format Errors - Verify your log/date/time format

 

날짜 형식 확인

$ date "+%Y-%b-%d"
2019- 9-20

$ date "+%Y-%b-%d"
2019-Sep-20

 

재실행 성공

$  goaccess --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format='%h - - %d:%^ %^ %T "%r" %s %b "%R" "%u"' -f ./accessLog201909042104.txt > ./accessLog201909042104.html
Warning: Failed to set locale category LC_NUMERIC to en_KR.
Warning: Failed to set locale category LC_TIME to en_KR.
Warning: Failed to set locale category LC_COLLATE to en_KR.
Warning: Failed to set locale category LC_MONETARY to en_KR.
Warning: Failed to set locale category LC_MESSAGES to en_KR.

 

'분석 > Go Access' 카테고리의 다른 글

GoAccess 1.3 분석  (0) 2020.02.06
GoAccess 1.3 설치 - 수동설치  (0) 2020.02.06