How to install GoAccess web log analyzer with Nginx on Linux or Unix

GoAccess is a real-time Apache/Nginx/Lighttpd web log analyzer and interactive viewer that runs in a terminal and provides fast and valuable HTTP statistics for system administrators that require a visual report on the fly. How do I install GoAccess on Ubuntu Linux server? How can I instal and use GoAccess on Linux or Unix-like system?

GoAccess is a free and open source real-time web log analyzer and interactive viewer that runs in a terminal in Linux/Unix/*BSD systems or through your browser. This tutorial shows how to install the GoAccess on Linux/Unix and how to use it on the *nix command line.

Install GoAccess

You must install GoAccess as per your Linux or Unix distro.

Install GoAccess on Ubuntu Linux

Type the following apt-get command/apt command as follows:
$ sudo apt-get install goaccess
Sample outputs:

Fig.01: How to install GoAccess on Ubuntu Linux server
Fig.01: How to install GoAccess on Ubuntu Linux server

Install GoAccess on Debian Linux

Type the following apt-get command/apt command as follows:
$ sudo apt-get install goaccess

Install GoAccess on Alpine Linux

Type the following apk command as follows:
# apk add goaccess

Install GoAccess on CentOS Linux

First turn on the EPEL repo and type the following yum command as follows:
$ sudo yum install epel-release
$ sudo yum install goaccess

Install GoAccess on Fedora Linux

First turn on the EPEL repo and type the following dnf command as follows:
$ sudo dnf install epel-release
$ sudo dnf install goaccess

Install GoAccess on Arch Linux

Type the following pacman command as follows:
# pacman -S goaccess

Install GoAccess on FreeBSD UNIX

To install the port:
# cd /usr/ports/sysutils/goaccess/ && make install clean
OR To add the package:
# pkg install goaccess

Install GoAccess on macOS UNIX (Homebrew)

Type the following brew command:
$ brew install goaccess

Install GoAccess on OpenBSD UNIX

Type the following pkg_add command:
$ doas pkg_add goaccess

Installing GoAccess using source code method

Type the following command to download and compile GoAccess on Unix-like system:
$ cd /tmp
$ wget http://tar.goaccess.io/goaccess-1.2.tar.gz
$ tar -zxvf goaccess-1.2.tar.gz
$ cd goaccess-1.2/
$ ./configure --enable-utf8 --enable-geoip=legacy && make
$ sudo make install

How do I use GoAccess?

The syntax is:
goaccess -f /path/to/nginx/access.log
goaccess -f /path/to/apache/access.log
goaccess -f /path/to/lighttpd/access.log
goaccess -f /path/to/lighttpd/access.log /path/to/lighttpd/access.log.1
zcat /path/to/nginx/access.log.*.gz | goaccess access.log -
goaccess [options] /path/to/lighttpd/access.log

Examples

Let us see some examples.

How can I see output on screen with a live report?

goaccess -f /var/log/nginx/access.log
You will be promoted to select “Log Format Configuration”:

Fig.02: Set the log-format for your log file
Fig.02: Set the log-format for your log file

Next you will see a report as follows:

Fig.03:  See an interactive report on screen
Fig.03: See an interactive report on screen

IMPORTANT SHORTCUT KEYS

You can use the following keys:

  • q – Quit the program.
  • h or ? – See help.
  • 0-9 and Shift + 0 – Set selected module to active.
  • j – Scroll down within expanded module.
  • k – Scroll up within expanded module.
  • c – Set or change scheme color.
  • ^f – Scroll forward one screen within active module.
  • ^b – Scroll backward one screen within active module.
  • TAB – Iterate modules (forward).
  • SHIFT + TAB – Iterate modules (backward).
  • s – Sort options for active module.
  • /Search – across all modules (regex allowed).
  • n – Find position of the next occurrence.
  • g – Move to the first item or top of screen.
  • G – move to the last item or bottom of screen.

How do I generate an HTML report?

The syntax is:
goaccess -f /var/log/nginx/access.log --log-format=COMBINED -o www.nixcraft.com.log.html
Sample outputs:

Parsing... [669] [1112]

You can view report with your web-browser. Here is a sample report:
https://www.cyberciti.biz/files/goaccess/www.nixcraft.com.log.html

How do I use goaccess over an ssh based session?

The syntax is:
$ ssh vivek@server1.cyberciti.biz 'cat /var/log/nginx/access.log'|goaccess --log-format=COMBINED -a -
$ ssh vivek@server1.cyberciti.biz 'cat /var/log/nginx/access.log'|goaccess --log-format=COMBINED -
$ ssh vivek@server1.cyberciti.biz 'cat /var/log/nginx/access.log'|goaccess --log-format=COMBINED -o www.nixcraft.com.log.htm -

How do I view real time stats in browser?

Run it as follows:
$ goaccess -f access.log -o report.html --real-time-html --addr=192.168.1.254 --port=8022

or

goaccess -f /var/log/nginx/access.log –log-format=COMBINED -o /usr/local/www/nginx/report.html –real-time-html –addr=10.100.100.1

Source : https://www.cyberciti.biz/faq/how-to-install-goaccess-web-log-analyzer-with-nginx-on-linux-or-unix/

Posted on: June 26, 2019, by :  | 20 views
https://serang.ut.ac.id/css/css/slot88/ https://tinjut.bagkeu.dikdasmen.kemdikbud.go.id/slot-maxwin/ https://dpm.polinema.ac.id/slot-gacor/ https://akademik.ft.unm.ac.id/slot-dana/ https://ppdb.probolinggokab.go.id/slot-5000/ https://bkad.sulselprov.go.id/assets/ https://ojs.balidwipa.ac.id/docs/slot-gacor/ http://korpri.pekalongankab.go.id/api/slot-gacor/ https://elang.umpp.ac.id/foto/farmasi/-/asset/ http://rsud-kelet.jatengprov.go.id/wp-content/-/asset/ https://kusdhianto-fe.staff.ugm.ac.id/slot88/ http://ppdb.probolinggokab.go.id/judi-bola/ https://bapenda.labuhanbatukab.go.id/racikan-sbobet/ http://rsud-kelet.jatengprov.go.id/wp-content/-/data/ https://agenda.riau.go.id/-/judi-bola/ https://balapan.padang.go.id/sbobet88/ http://jdih.wakatobikab.go.id/sbobet88/ http://kph.menlhk.go.id/sbobet88/ https://bkad.sulselprov.go.id/data/ https://dpm.polinema.ac.id/slot-gacor/ https://dinkes.jemberkab.go.id/storage/attachments/