Ubuntu22.04にWebログ解析ツールGoAccessをインストールする

環境
OSバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

操作方法
1.システムアップデートを行います

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo apt update
# sudo apt update
# sudo apt update

2.aptでgoaccessをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo apt install goaccess
# sudo apt install goaccess
# sudo apt install goaccess

3.goaccessのバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# goaccess --v
GoAccess - 1.5.5.
For more details visit: https://goaccess.io/
Copyright (C) 2009-2022 by Gerardo Orellana
Build configure arguments:
--enable-utf8
--enable-geoip=mmdb
--with-openssl
# goaccess --v GoAccess - 1.5.5. For more details visit: https://goaccess.io/ Copyright (C) 2009-2022 by Gerardo Orellana Build configure arguments: --enable-utf8 --enable-geoip=mmdb --with-openssl
# goaccess --v
GoAccess - 1.5.5.
For more details visit: https://goaccess.io/
Copyright (C) 2009-2022 by Gerardo Orellana

Build configure arguments:
  --enable-utf8
  --enable-geoip=mmdb
  --with-openssl

4.goaccessを起動します
使用例
apacheのlogデータを使用します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# goaccess /var/log/apache2/access.log
# goaccess /var/log/apache2/access.log
# goaccess /var/log/apache2/access.log

5.goaccessの設定
spaceキーを押して「Common Log Format (CLF)」を選択します。
ログ形式
%v:%^ %h %^[%d:%t %^] “%r" %s %b

日付形式
%d/%b/%Y

時刻形式
%H:%M:%S

Ubuntu 22.04

Posted by arkgame