goaccess (1) - Linux Man Pages
goaccess: fast web log analyzer and interactive viewer.
NAMEgoaccess - fast web log analyzer and interactive viewer.
DESCRIPTIONgoaccess GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
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:
- This panel gives a summary of several metrics, some of them are: number of valid and invalid requests, time taken to analyze the data set, unique visitors, requested files, static files (CSS, ICO, JPG, etc) HTTP referrers, 404s, size of the parsed log file and bandwidth consumption.
- Unique visitors
- This panel shows metrics such as hits, unique visitors and cumulative bandwidth per date. HTTP requests containing the same IP, the same date, and the same user agent are considered a unique visitor. By default, it includes web crawlers/spiders.
- Optionally, date specificity can be set to the hour level using --date-spec=hr which will display dates such as 05/Jun/2016:16. This is great if you want to track your daily traffic at the hour level.
- Requested files
- This panel displays the most highly requested files on your web server. It shows hits, unique visitors, and percentage, along with the cumulative bandwidth, protocol, and the request method used.
- Requested static files
- Lists the most frequently static files such as: JPG, CSS, SWF, JS, GIF, and PNG file types, along with the same metrics as the last panel. Additional static files can be added to the configuration file.
- 404 or Not Found
- Displays the same metrics as the previous request panels, however, its data contains all pages that were not found on the server, or commonly known as 404 status code.
This panel has detailed information on the hosts themselves. This is great for
spotting aggressive crawlers and identifying who's eating your bandwidth.
Expanding the panel can display more information such as host's reverse DNS lookup result, country of origin and city. If the -a argument is enabled, a list of user agents can be displayed by selecting the desired IP address, and then pressing ENTER.
- Operating Systems
- This panel will report which operating system the host used when it hit the server. It attempts to provide the most specific version of each operating system.
- This panel will report which browser the host used when it hit the server. It attempts to provide the most specific version of each browser.
- Visit Times
- This panel will display an hourly report. This option displays 24 data points, one for each hour of the day.
- Optionally, hour specificity can be set to the tenth of a minute level using --hour-spec=min which will display hours as 16:4 This is great if you want to spot peaks of traffic on your server.
- Virtual Hosts
- This panel will display all the different virtual hosts parsed from the access log. This panel is displayed if %v is used within the log-format string.
- Referrers URLs
- If the host in question accessed the site via another resource, or was linked/diverted to you from another host, the URL they were referred from will be provided in this panel. See `--ignore-panel` in your configuration file to enable it. disabled by default.
- Referring Sites
- This panel will display only the host part but not the whole URL. The URL where the request came from.
- It reports keyphrases used on Google search, Google cache, and Google translate that have lead to your web server. At present, it only supports Google search queries via HTTP. See `--ignore-panel` in your configuration file to enable it. disabled by default.
- Geo Location
- Determines where an IP address is geographically located. Statistics are broken down by continent and country. It needs to be compiled with GeoLocation support.
- HTTP Status Codes
The values of the numeric status code to HTTP requests.
NOTE: Optionally and if configured, all panels can display the average time taken to serve the request.
There are three storage options that can be used with GoAccess. Choosing one will depend on your environment and needs.
- Default Hash Tables
- In-memory storage provides better performance at the cost of limiting the dataset size to the amount of available physical memory. By default GoAccess uses in-memory hash tables. If your dataset can fit in memory, then this will perform fine. It has very good memory usage and pretty good performance.
- Tokyo Cabinet On-Disk B+ Tree
- Use this storage method for large datasets where it is not possible to fit everything in memory. The B+ tree database is slower than any of the hash databases since data has to be committed to disk. However, using an SSD greatly increases the performance. You may also use this storage method if you need data persistence to quickly load statistics at a later date.
- Tokyo Cabinet In-memory Hash Database
- An alternative to the default hash tables. It uses generic typing and thus it's performance in terms of memory and speed is average.
Multiple options can be used to configure GoAccess. For a complete up-to-date list of configure options, run ./configure --help
- Compile with debugging symbols and turn off compiler optimizations.
- Compile with wide character support. Ncursesw is required.
- Compile with GeoLocation support. MaxMind's GeoIP is required.
- Compile with Tokyo Cabinet storage support.memhash will utilize Tokyo Cabinet's on-memory hash database. btree will utilize Tokyo Cabinet's on-disk B+ Tree database.
- Disable zlib compression on B+ Tree database.
- Disable bzip2 compression on B+ Tree database.
- Use GNU getline() to parse full line requests instead of a fixed size buffer of 4096.
The following options can be supplied to the command or specified in the configuration file. If specified in the configuration file, long options need to be used without prepending --.
- The time-format variable followed by a space, specifies the log format time containing either a name of a predefined format (see options below) or any combination of regular characters and special format specifiers.
- They all begin with a percentage (%) sign. See `man strftime`.%T or %H:%M:%S.
- Note that if a timestamp is given in microseconds, %f must be used as time-format
- The date-format variable followed by a space, specifies the log format time containing either a name of a predefined format (see options below) or any combination of regular characters and special format specifiers.
- They all begin with a percentage (%) sign. See `man strftime`.%Y-%m-%d.
- Note that if a timestamp is given in microseconds, %f must be used as date-format
- The log-format variable followed by a space or\\t for tab-delimited, specifies the log format string.
Note that if there are spaces within the format, the string needs to be enclosed in single/double quotes. Inner quotes need to be escaped.
- In addition to specifying the raw log/date/time formats, for simplicity, any of the following predefined log format names can be supplied to the log/date/time-format variables. GoAccess can also handle one predefined name in one variable and another predefined name in another variable.
COMBINED - Combined Log Format,
VCOMBINED - Combined Log Format with Virtual Host,
COMMON - Common Log Format,
VCOMMON - Common Log Format with Virtual Host,
W3C - W3C Extended Log File Format,
SQUID - Native Squid Log Format,
CLOUDFRONT - Amazon CloudFront Web Distribution,
CLOUDSTORAGE - Google Cloud Storage,
AWSELB - Amazon Elastic Load Balancing,
- -a --agent-list
- Enable a list of user-agents by host. For faster parsing, do not enable this flag.
- -c --config-dialog
- Prompt log/date configuration window on program start.
- -p --config-file=<configfile>
- Specify a custom configuration file to use. If set, it will take priority over the global configuration file (if any).
- Send all debug messages to the specified file.
- -e --exclude-ip=<IP|IP-range>
- Exclude an IPv4 or IPv6 from being counted. Ranges can be included as well using a dash in between the IPs (start-end).
- -g --std-geoip
- Standard GeoIP database for less memory usage.
- -h --help
- The help.
- -i --hl-header
- Color highlight active panel.
- -M --http-method=<yes|no>
- Set/unset HTTP request method. This will create a request key containing the request method + the actual request.
- -H --http-protocol=<yes|no>
- Set/unset HTTP request protocol. This will create a request key containing the request protocol + the actual request.
- -f --log-file=<logfile>
- Specify the path to the input log file. If set in the config file, it will take priority over -f from the command line.
- -q --no-query-string
- Ignore request's query string. i.e., www.google.com/page.htm?query => www.google.com/page.htm.
- -r --no-term-resolver
- Disable IP resolver on terminal output.
- -o --output=<path/file.[json|csv|html]>
- Write output to stdout given one of the following files and the corresponding extension for the output format:
/path/file.csv - Comma-separated values (CSV)
/path/file.html - HTML
- -s --storage
- Display current storage method. i.e., B+ Tree, Hash.
- -V --version
- Display version information and exit.
- -m --with-mouse
- Enable mouse support on main dashboard.
- -d --with-output-resolver
- Enable IP resolver on HTML|JSON output.
- Treat non-standard status code 444 as 404.
- Add 4xx client errors to the unique visitors count.
- Specify IP address to bind the server to. Otherwise it binds to 0.0.0.0.
- Usually there is no need to specify the address, unless you intentionally would like to bind the server to a different address within your server.
- Include static files that contain a query string.
- ---color=<fg:bg[attrs, PANEL]>
- Specify custom colors for the terminal output.
DEFINITION space/tab colorFG#:colorBG# [attributes,PANEL]
FG# = foreground color [-1...255] (-1 = default term color)
BG# = background color [-1...255] (-1 = default term color)
Optionally, it is possible to apply color attributes (multiple attributes are comma separated), such as: bold, underline, normal, reverse, blink
If desired, it is possible to apply custom colors per panel, that is, a metric in the REQUESTS panel can be of color A, while the same metric in the BROWSERS panel can be of color B.
Available color definitions:
See configuration file for a sample color scheme.
- Choose among color schemes.1 for the default grey scheme. 2 for the green scheme.
- Set the date specificity to either date (default) or hr to display hours appended to the date.
- This is used in the visitors panel. It's useful for tracking visitors at the hour level. For instance, an hour specificity would yield to display traffic as 18/Dec/2010:19
- Display the path of the default config file when `-p` is not used.
- Decode double-encoded values. This includes, user-agent, request, and referer.
- Enable parsing and displaying the given panel.
- Set the time specificity to either hour (default) or min to display the tenth of a minute appended to the hour.
- This is used in the time distribution panel. It's useful for tracking peaks of traffic on your server at specific times.
- Specifies a custom CSS file path to load in the HTML report.
- Specifies a custom JS file path to load in the HTML report.
- Set HTML report page title and header.
- Ignore crawlers from being counted.
- Ignore parsing and displaying the given panel.
- Ignore referers from being counted. Wildcards allowed. e.g.,*.domain.com ww?.domain.*
- Ignore parsing and displaying one or multiple status code(s). For multiple status codes, use this option multiple times.
- Log invalid requests to the specified file.
- Format JSON output using tabs and newlines.
- The maximum number of items to display per panel. The maximum can be a number between 1 and n.
- Turn off colored output. This is the default output on terminals that do not support colors.
- Don't write column names in the terminal output. By default, it displays column names for each available metric in every panel.
- Disable summary metrics on the CSV output.
- Do not load the global configuration file. This directory should normally be /usr/local/etc, unless specified with--sysconfdir=/dir.
- Disable progress metrics [total requests/requests per second].
- Disable scrolling through panels when TAB is pressed or when a panel is selected using a numeric key.
- Ensure clients send the specified origin header upon the WebSocket handshake.
- Specify the port to use. By default GoAccess listens on port 7890 for the WebSocket server.
- Display real OS names. e.g, Windows XP, Snow Leopard.
- Enable real-time HTML output.
- GoAccess uses its own WebSocket server to push the data from the server to the client. See http://gwsocket.io for more details how the WebSocket server works.
- Sort panel on initial load. Sort options are separated by comma. Options are in the form: PANEL,METRIC,ORDER
BY_HITS - Sort by hits
BY_VISITORS - Sort by unique visitors
BY_DATA - Sort by data
BY_BW - Sort by bandwidth
BY_AVGTS - Sort by average time served
BY_CUMTS - Sort by cumulative time served
- -a --agent-list