AndyJarrett

Accessing HTTP referrers with GoAccess

Under the hood, GoAccess has a wide range of settings you can access via goaccess.conf

First job is to find your .conf file

$ goaccess --dcf
Once there, open the file, and search enable-panel
# Enable parsing/displaying the given panel.
#
#enable-panel VISITORS
#enable-panel REQUESTS
#enable-panel REQUESTS_STATIC
#enable-panel NOT_FOUND
#enable-panel HOSTS
enable-panel OS # Removed comment
enable-panel BROWSERS # Removed comment
#enable-panel VISIT_TIMES
#enable-panel VIRTUAL_HOSTS
enable-panel REFERRERS # Removed comment
enable-panel REFERRING_SITES # Removed comment
enable-panel KEYPHRASES # Removed comment
#enable-panel STATUS_CODES
#enable-panel REMOTE_USER
#enable-panel CACHE_STATUS
enable-panel GEO_LOCATION # Removed comment
#enable-panel MIME_TYPE
#enable-panel TLS_TYPE

Once set you can then go and run $ goaccess /var/log/nginx/access.log --log-format=COMBINED and see some referring data

e.g.

Referrers URLs Total: 21/21

 Hits     h% Vis.     v% Tx. Amount Data
 ---- ------ ---- ------ ---------- ----
  372 90.07%  106 88.33%   5.88 MiB -
    9  2.18%    0  0.00%    0.0   B http://xxx.yyy.zzz/example.html
    6  1.45%    6  5.00%  12.79 KiB https://xxx.yyy.zzz/example.html
    5  1.21%    1  0.83% 266.99 KiB http://xxx.yyy.zzz/example.html
    2  0.48%    1  0.83%   2.95 KiB https://xxx.yyy.zzz/example.html
    2  0.48%    2  1.67%  19.84 KiB http://xxx.yyy.zzz/example.html
    2  0.48%    2  1.67%   2.79 KiB https://xxx.yyy.zzz/example.html