We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.25.3. Analysis of logs in GoAccess

GoAccess Is a free open source console program for viewing and analyzing web server logs. Designed for Linux and macOS. On Windows, you can use its implementation CowAxessrunning via Cygwin or directly via WSL.

To analyze logs using GoAccess, you need them first download.

To run the program in interactive mode, do the following:

  1. In the console, run the command substituting for path/to/access.log let the log file:
    goaccess path/to/access.log

    If you need to analyze several logs at once, specify the paths to them separated by a space:

    goaccess path/to/access.log path/to/access.log.1
  2. Using the arrows and keys Space set the switch opposite to "NCSA Combined Log Format" and press Enter.
  3. Wait for the log processing to complete.

The following modules are available in the program:

  1. «Unique visitors per day - Including spiders"- the number of unique visitors per day, including spiders.
  2. «Requested Files (URLs)"- requested URL.
  3. «Static Requests"- requests to static files.
  4. «Not Found URLs (404s)"- requests for which the server returned a response 404.
  5. «Visitor Hostnames and IPs»- IP addresses, countries and hosts of visitors.
  6. «Operating Systems"- operating systems of visitors.
  7. «Browsers"- browsers of visitors.
  8. «Time Distribution"- distribution of requests by hours for.
  9. «Virtual Hosts"- virtual hosts. The module will be displayed only if there is relevant information in the log.
  10. «Referrers"(Disabled by default) - URL from which visitors came.
  11. «Referring Sites»- sites from which visitors came.
  12. «Keyphrases»(Disabled by default) - key phrases from Google search queries, Google cache (only HTTP requests are supported).
  13. «HTTP Status Codes"- server responses.
  14. «Remote User"- identifiers of persons requesting files with HTTP authentication. The module will be displayed only if there is relevant information in the log.
  15. «Geo Location"- the countries of the visitors.

To work with the program in interactive mode, use the following keys:

  • F1 or h - call for help.
  • F5 - updating information in the main window.
  • q - exit from the program or minimize the active module.
  • o or Enter - expanding the active module.
  • 09 and Shift+05 - module activation by its number (Shift must be held for modules with numbers 10+).
  • - scrolling up the contents of the main window.
  • - scroll down the contents of the main window.
  • j - moving the cursor down inside the expanded module.
  • k - moving the cursor up inside the expanded module.
  • c - setting or changing the color scheme.
  • Ctrl+f - scrolling forward one screen inside the active module.
  • Ctrl+b - scrolling back one screen inside the active module.
  • Tab - switching to the next module.
  • Shisft+Tab - switching to the previous module.
  • s - sorting setting for the active module.
  • / - search in all active modules (you can use regular expressions).
  • n - search for the next match.
  • g - go to the first element of the module or up the main window.
  • Shift+G - go to the last element of the module or down the main window.

Note

HTML- reports for the day or month can be generated directly in the control panel in access logs.

Note

Instead of editing the configuration file, you can also explicitly specify the format directly in the command generatingby adding keys: --log-format='%h %^[%d:%t %^] "%r" %s %b "%R" "%u"' --date-format='%d/%b/%Y' --time-format='%T'.

Before generating HTML-report, specify the format of the log, date and time in the GoAccess configuration file:

  1. Find out the path to the GoAceess config file by running the command:
    goaccess --dcf
  2. Open the configuration file for editing by running the command:
    nano way/to/configuration/file
  3. Add three lines to it:
    log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
    date-format %d/%b/%Y
    time-format %T
  4. Save changes with the combination Ctrl+O.
  5. Exit the editor with the shortcut Ctrl+X

To generate HTML-report run the command:

goaccess path/to/access.log -a -o path/to/report.html
  • Instead path/to/access.log substitute it for the log file.
  • Instead path/to/report.html specify the name of the report and the path where you want to save it.

Open the resulting file in any browser. The report will clearly reflect information on all available modules with the ability to customize the display.