goaccess(1)

NAME
goaccess - fast web log analyzer and interactive viewer.

SYNOPSIS

goaccess [-f input-file][-c][-r][-d][-m][-q][-o][-h][...]

DESCRIPTION
goaccess is a free (GPL) real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly. GoAccess parses the specified web log file and outputs the data to the X terminal. Features include:

General Statistics:
    Number of valid requests, number of invalid requests, time to analyze the data, unique visitors, unique requested files, unique static files (css, ico, jpg, js, swf, gif, png) unique HTTP referrers (URLs), unique 404s (not found), size of the parsed log file, bandwidth consumption.

Unique visitors:
    HTTP requests having the same IP, same date and same agent will be considered a unique visit. This includes crawlers.

Requested files
    Hit totals are based on total requests. This module will display hits, percent, bandwidth [time served], [protocol] and [method].

Requested static files
    Hit totals are based on total requests. Includes files such as: jpg, css, swf, js, gif, png etc. This module will display hits, percent, bandwidth, [time served], [protocol] and [method].

404 or Not Found
    Hit totals are based on total requests. This module will display hits, percent, bandwidth, [time served], [protocol] and [method].

Hosts
    Hit totals are based on total requests. This module will display hits, percent, [bandwidth, time served]. The expanded module can display extra information such as reverse DNS and country. If -a is enabled, a list of user agents will be displayed by selecting the IP and hitting the return key.

Operating Systems
    Hit totals are based on unique visitors. This module will display hits and percent. The expanded module shows all available versions of the parent node.

Browsers
    Hit totals are based on unique visitors. This module will display hits and percent. The expanded module shows all available versions of the parent node.

Referrers URLs
    The URL where the request came from. Hit totals are based on total requests. This module will display hits and percent.

Referring Sites
    This module will display only the host but not the whole URL. The URL where the request came from. Hit totals are based on total requests. This module will display hits and percent.

Keyphrases
    This module will report keyphrases used on Google search, Google cache, and Google translate. Hit totals are based on total requests. This module will display hits and percent.

Geo Location
    Determines where an IP address is geographically located. It outputs the continent and country. If it's unable to determine the country, location will be marked as unknown.

HTTP Status Codes
    The values of the numeric status code to HTTP requests. Hit totals are based on total requests. This module will display hits and percent.

OPTIONS

-f <input-file>
    Path to input log file.

-a --agent-list
    Enable a list of user-agents for the selected host.

-c --conf-dialog
    Prompt date and log format configuration window.

-d --with-output-resolver
    Enable IP resolver on html|json output.

-e --exclude-ip=IP
    Exclude an IP from being counted.

-g --std-geoip
    Standard GeoIP database for less memory usage.

-l --log-file=<filename>
    Send all debug messages to the specified file.

-h --help
    The help.

-H --http-protocol
    Include HTTP request protocol.

-m --with-mouse
    Enable mouse support on main dashboard.

-M --http-method
    Include HTTP request method.

-o --output-format=csv|json
    Output format: "-o csv" for CSV. "-o json" for JSON.

-p --conf-file=<filename>
    Use a custom configuration file.

-q --no-query-string
    Ignore request's query string.

-r --no-term-resolver
    Disable IP resolver on terminal output.

--no-color
    Disable colored output.

--real-os
    Display real OS names. e.g, Windows XP, Snow Leopard.

CUSTOM LOG/DATE FORMAT
GoAccess can parse virtually any web log format.

Predefined options include, Common Log Format (CLF), Combined Log Format (XLF/ELF), including virtual host, Amazon CloudFront (Download Distribution) and W3C format (IIS).

GoAccess allows any custom format string as well.

There are two ways to configure the log format. The easiest is to run GoAccess with -c to prompt a configuration window. Otherwise, it can be configured under ~/.goaccessrc.

date_format
    The date_format variable followed by a space, specifies the log format date containing any combination of regular characters and special format specifiers. They all begin with a percentage (%) sign. See http://linux.die.net/man/3/strftime

log_format
    The log_format variable followed by a space or \\t , specifies the log format string.

%d  date field matching the date_format variable.

%h  host (the client IP address, either IPv4 or IPv6)

%r  The request line from the client. This requires specific delimiters around the request (as single quotes, double quotes, or anything else) to be parsable. If not, we have to use a combination of special format specifiers as %m %U %H.

%m  The request method.

%U  The URL path requested (including any query string).

%H  The request protocol.

%s  The status code that the server sends back to the client.

%b  The size of the object returned to the client.

%R  The "Referer" HTTP request header.

%u  The user-agent HTTP request header.

%D  The time taken to serve the request, in microseconds.

%T  The time taken to serve the request, in seconds or milliseconds. Note: %D will take priority over %T if both are used.

%^  Ignore this field.

GoAccess requires the following fields:

    %h a valid IPv4/6

    %d a valid date

    %s server status code

    %r the request

INTERACTIVE MENU

F1 or h
    Main help.

F5  Redraw main window.

q   Quit the program, current window or collapse active module

o or  ENTER
    Expand selected module or open window

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.

TAB Forward iteration of modules. Starts from current active module.

SHIFT + TAB
    Backward iteration of modules. Starts from current active module.

^ f Scroll forward one screen within an active module.

^ b Scroll backward one screen within an active module.

s   Sort options for active module

/   Search across all modules (regex allowed)

n   Find the position of the next occurrence across all modules.

g   Move to the first item or top of screen.

G   Move to the last item or bottom of screen.

EXAMPLES
The simplest and fastest usage would be:

    # goaccess -f access.log

That will generate an interactive text-only output.

To generate full statistics we can run GoAccess as:

    # goaccess -f access.log -a

To generate an HTML report:

    # goaccess -f access.log -a > report.html

To generate a JSON file:

    # goaccess -f access.log -a -d -o json > report.json

To generate a CSV file:

    # goaccess -f access.log -o csv > report.csv

The -a flag indicates that we want to process an agent-list for every host parsed.

The -d flag indicates that we want to enable the IP resolver on the HTML | JSON output. (It will take longer time to output since it has to resolve all queries.)

The -c flag will prompt the date and log format configuration window. Only when curses is initialized.

Now if we want to add more flexibility to GoAccess, we can do a series of pipes. For instance:

If we would like to process all access.log.*.gz we can do:

    # zcat access.log.*.gz | goaccess

OR

    # zcat -f access.log* | goaccess

Another useful pipe would be filtering dates out of the web log

The following will get all HTTP requests starting on 05/Dec/2010 until the end of the file.

    # sed -n '/05\/Dec\/2010/,$ p' access.log | goaccess -a

If we want to parse only a certain time-frame from DATE a to DATE b, we can do:

    sed -n '/5\/Nov\/2010/,/5\/Dec\/2010/ p' access.log | goaccess -a

Note that this could take longer time to parse depending on the speed of sed.

To exclude a list of virtual hosts you can do the following:

    grep -v "`cat exclude_vhost_list_file`" vhost_access.log | goaccess

Also, it is worth pointing out that if we want to run GoAccess at lower priority, we can run it as:

    # nice -n 19 goaccess -f access.log -a

and if you don't want to install it on your server, you can still run it from your local machine:

    # ssh root@server 'cat /var/log/apache2/access.log' | goaccess -a

NOTES
For now, each active window has a total of 300 items. Eventually this will be customizable.

Piping a log to GoAccess will disable the real-time functionality. This is due to the portability issue on determining the actual size of STDIN. However, a future release *might* include this feature.

BUGS
If you think you have found a bug, please send me an email to goaccess@prosoftcorp.com or use the issue tracker in https://github.com/allinurl/goaccess/issues

AUTHOR
Gerardo Orellana <goaccess@prosoftcorp.com> For more details about it, or new releases, please visit http://goaccess.prosoftcorp.com