Skip to main content

How to visualize Access Logs with a fancy interface and charts

Comments

3 comments

  • Matthias Van Woensel

    Note that we do trim logs and this means it might be that the first line of the log file is not correctly formatted.
    When running the above, you could end up with an error like

    goaccess access.log --log-format=COMBINED -o report.html
    access.log [0] [0/s]
    Parsed 1 linesproducing the following errors:
    
    Token 'lessChrome/87.0.4280.141' doesn't match specifier '%h'
    
    Format Errors - Verify your log/date/time format
    

    To resolve this, simply remove the first line of the log file like this (this will create a new file, change the below however you feel like):
    tail -n +2 access.log > access.log.withoutfirstline.log

    0
  • Kasper Garnæs

    Another option for filtering out the initial output from the platform.sh log command is to redirect stderr:

    platform log access --tail 2>/dev/null | goaccess --log-format=COMBINED -

    0
  • Kasper Garnæs

    You can also use GoAccess to analyse response times from PHP based on the PHP access log. The log format here is quite different but the configuration options in GoAccess makes it quite flexible.

    platform log php.access --tail 2>/dev/null | goaccess --datetime-format='%Y-%m-%dT%H:%M:%SZ' --log-format='%x %m %s %L.%^ %h %^ %^ %^%r' --no-ip-validation

    0

Please sign in to leave a comment.