From afbc2eec1881a63b9f25dde26c654c227b58c5ee Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 28 Dec 2022 22:37:10 -0500 Subject: [PATCH] changed format --- init.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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