#!/bin/bash ##################################################################### # # This is a simple shell script that will use goaccess to generate web # log analytics from nginx-proxy-manager proxy host logs. The resultant # html report files will be written into the html directory of another # nginx web host. # # This instance of goaccess has IP geolocation enabled, and requires # the presence of a GeoLite2 geo ip database from MaxMind # (https://www.maxmind.com). # ##################################################################### ##################################################################### # variable definitions # today's date, in logfile format dateToday=$(date +"%0d/%b/%Y") # log dir logDir="/opt/docker/docker_nginx-proxy-manager/data/logs" # goaccess binary goBin="/usr/local/bin/goaccess" # destination dir dstDir="/opt/docker/docker_nginx-go.delfax.net/go.delfax.net/html" # set up our array of 'hostname:logfile' declare logfiles # array entries for hostname:logfile logfiles=("delfax.net:proxy-host-1_access.log" \ "www.delfax.net:proxy-host-9_access.log" \ "radar231.com:proxy-host-4_access.log" \ "www.radar231.com:proxy-host-10_access.log" \ "git.radar231.com:proxy-host-5_access.log" \ "go.delfax.net:proxy-host-14_access.log" \ "npm.delfax.net:proxy-host-6_access.log" \ "jmc.delfax.net:proxy-host-7_access.log" \ ) # goaccess args geoipArg="/opt/bin/GeoLite2-City/GeoLite2-City.mmdb" timeArg='%H:%M:%S' dateArg='%d/%b/%Y' # a format string structured for nginx-proxy-manager proxy host logs formatArg='[%d:%t %^] %^ %^ %s - %m %^ %v %U [Client %h] [Length %b] [Gzip %^] [Sent-to %^] %u %R' ##################################################################### # We'll create an index.html file that contains links to all of our # generated report files # create the header for our index.html cat >${dstDir}/index.html < goaccess index

NPM Proxy Host Web Analytic Reports