diff --git a/init.sh b/init.sh index afcfcfb..1c5179e 100644 --- a/init.sh +++ b/init.sh @@ -10,8 +10,10 @@ FILELOC='/var/www/html' # set log format cd $CONFLOC +# remove irrelevant formats perl -pi -e 's/^LogFormat(?!.* combined)$/# LogFormat/gm' apache2.conf -perl -pi -e 's/^LogFormat.* combined$/LogFormat "%h,%t,%s,%H,%f" combined/gm' apache2.conf +# set used one to IP,YYMMDD hhmmss TIMEZONE,STATUS,METHOD,FILE +perl -pi -e 's;^LogFormat.* combined$;LogFormat "%h,%\{%y/%m/%d %H:%M:%S %z\}t,%s,%m,%f" combined;gm' apache2.conf function createfile { # usage: createfile FILENAME