- Download & Install GoAccess: https://goaccess.io/download
sudo apt install goaccess
- Check your Tomcat Access_Log_Valve pattern
https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Log_Valve
For Example:
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="{{ tomcat_log_dir }}"
rotatable="false"
prefix="access.log"
pattern="%t %h %l %u %r %s %b %D"
requestAttributesEnabled="true"
/>
- Map Access_Log_Valve Pattern to the GoAccess CUSTOM LOG/DATE FORMAT
Check your tomcat access.log format:
[22/May/2023:03:17:00 +0200] 192.116.174.250 - - POST /alfresco/service/api/solr/modelsdiff HTTP/1.1 200 37 19
[22/May/2023:03:17:00 +0200] 192.116.174.250 - - GET /alfresco/service/api/solr/aclchangesets?fromTime=1684718210001&toTime=1684725410001&maxResults=2000 HTTP/1.1 200 130 4
[22/May/2023:03:17:00 +0200] 192.116.174.250 - - GET /alfresco/service/api/solr/transactions?fromCommitTime=1684717200436&toCommitTime=1684720800436&maxResults=2000 HTTP/1.1 200 254 4
[22/May/2023:03:17:00 +0200] 192.116.174.250 - - GET /alfresco/service/api/solr/aclchangesets?fromTime=1684718210001&toTime=1684725410001&maxResults=2000 HTTP/1.1 200 130 5
[22/May/2023:03:17:00 +0200] 192.116.174.250 - - GET /alfresco/service/api/solr/transactions?fromCommitTime=1684720800436&toCommitTime=1684724400436&maxResults=2000 HTTP/1.1 200 119 4
[22/May/2023:03:17:00 +0200] 192.116.174.250 - - GET /alfresco/service/api/solr/transactions?fromCommitTime=1684717200436&toCommitTime=1684720800436&maxResults=2000 HTTP/1.1 200 254 3
an map the Valve Pattern to the SPECIFIERS at https://goaccess.io/man#custom-log and build your go access log Format:
goaccess --date-format='%d/%b/%Y' --time-format='%H:%M:%S' --log-format='[%d:%t %^] %h %^ %^ %m %r %H %s %b %T' -f access.log
- Add Additional Output Format to display the statistics in a webbrowser:
goaccess --date-format='%d/%b/%Y' --time-format='%H:%M:%S' --log-format='[%d:%t %^] %h %^ %^ %m %r %H %s %b %T' -f access.log --output=html --hour-spec=hour -a > access_log_goaccess.html