LinuxCommandLibrary

goaccess

Analyze web server access logs

TLDR

Analyze one or more log files in interactive mode

$ goaccess [path/to/logfile1 path/to/file2 ...]
copy

Use a specific log-format (or pre-defined formats like "combined")
$ goaccess [path/to/logfile] --log-format=[format]
copy

Analyze a log from stdin
$ tail [[-f|--follow]] [path/to/logfile] | goaccess -
copy

Analyze a log and write it to an HTML file in real-time
$ goaccess [path/to/logfile] [[-o|--output]] [path/to/file.html] --real-time-html
copy

SYNOPSIS

goaccess [options] [log_file...]

PARAMETERS

-f
    Specify the input log file. Multiple log files can be specified.

-c
    Prompt for configuration options.

-o
    Specify the output file. Can be HTML, JSON, CSV.

-p
    Specify the path to the configuration file.

-a
    Enable processing all available modules (Default is off for performance).

-d
    Enable debugging output to stderr.

-h
    Display this help message and exit.

-i
    Ignore case sensitivity.

-q
    Suppress errors and warnings.

--config-file=
    Path to the configuration file.

--help
    Display this help message and exit.

--version
    Display version information and exit.

DESCRIPTION

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal or through your browser. It provides fast and valuable HTTP statistics for system administrators. It is designed to be a command-line tool that quickly parses and analyzes web server access logs. It is written in C and requires only ncurses as a dependency, making it highly efficient and portable.

GoAccess supports multiple log formats, including Apache, Nginx, Amazon S3, and CloudFront. It allows users to customize the output format and generate HTML, JSON, or CSV reports. It's useful for getting a quick overview of website traffic, identifying bottlenecks, and detecting potential security threats by visualizing various metrics like top visitors, requested files, referring sites, and operating systems.

CAVEATS

GoAccess relies on the accuracy and completeness of the web server logs. Incomplete or corrupted logs can lead to inaccurate statistics. Also, the tool's real-time analysis is dependent on the rate at which the logs are updated.

REAL-TIME ANALYSIS

GoAccess can analyze logs in real-time. By piping log data to GoAccess, you can continuously monitor your web server traffic. For example: tail -f /var/log/nginx/access.log | goaccess

OUTPUT FORMATS

GoAccess supports generating reports in different formats, including HTML, JSON, and CSV. This allows you to easily integrate the analysis into other tools or systems. Use the -o option to specify the output file and format.

MODULES

GoAccess has support for several modules like: visitors, requested files, referring sites, operating systems. Each module provides valuable information on your site. Use the -a option to enable them.

HISTORY

GoAccess was originally developed by Gerardo Orellana. It was designed to provide a simple and efficient way to analyze web server logs directly from the command line. Since its initial release, it has gained popularity due to its speed, ease of use, and the ability to generate reports in various formats. The project has evolved with continuous updates adding more features, improved performance, and expanded log format support.

The tool's focus has always been on providing a lightweight and dependency-free solution for web log analysis, making it a valuable tool for system administrators and developers.

SEE ALSO

awk(1), grep(1), tail(1)

Copied to clipboard