From 71ad7a36ac01b2f750be1dc8896fa089bfc59e72 Mon Sep 17 00:00:00 2001 From: Generic Wiki User Date: Mon, 7 Dec 2015 23:45:33 +0000 Subject: [PATCH 1/2] use recode instead of iconv in convertELBLogToApacheFormat script --- configuration/convertELBLogToApacheFormat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/convertELBLogToApacheFormat b/configuration/convertELBLogToApacheFormat index 4563874bf6e..2341923b4dd 100755 --- a/configuration/convertELBLogToApacheFormat +++ b/configuration/convertELBLogToApacheFormat @@ -6,7 +6,7 @@ for i in $*; do gzip -cd $i else cat $i - fi | iconv -f ISO-8859-1 -t UTF8 | + fi | recode ISO-8859-1..UTF-8 | sed -e 's/^\([^T]*\)T\([^.]*\)[^ ]* [^ ]* \([^:]*\):[^ ]* [^ ]* [^ ]* [^ ]* [^ ]* [^ ]* \([^ ]*\) \([^ ]*\) [^ ]* \(\"[^"]*\"\) \(\"[^"]*\"\).*$/'$PREFIX' \3 - - [\1:\2 +0000] \6 \4 \5 "http:\/\/'$PREFIX'" \7/' | sed -e 's/\[\([0-9]*\)-01-\([0-9]*\):/\[\2\/Jan\/\1:/' | sed -e 's/\[\([0-9]*\)-02-\([0-9]*\):/\[\2\/Feb\/\1:/' | From 55a0ad44f84095c9679f85d84f9f51e14ceb7da8 Mon Sep 17 00:00:00 2001 From: Generic Wiki User Date: Mon, 7 Dec 2015 23:45:56 +0000 Subject: [PATCH 2/2] fixed generation of per-month unique visitors reporting filenames, replacing / by - --- configuration/unique_ips_per_referrer | 6 +++--- .../unique_ips_per_referrer_generate_month_results_only | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configuration/unique_ips_per_referrer b/configuration/unique_ips_per_referrer index 518f7f27509..612d7b77447 100755 --- a/configuration/unique_ips_per_referrer +++ b/configuration/unique_ips_per_referrer @@ -28,7 +28,7 @@ for i in $*; do gzip -cd $i else cat $i - fi | iconv -f ISO-8859-1 -t UTF8 | sed -e 's/^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \[\([^:]*\):\([^]]*\)\] \"[^"]*\" [^ ]* [^ ]* \"[^"]*\" \"\([^"]*\)\"/\1 \2 \5 \7/' | while read referrer hit; do + fi | recode ISO-8859-1..UTF-8 | sed -e 's/^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \[\([^:]*\):\([^]]*\)\] \"[^"]*\" [^ ]* [^ ]* \"[^"]*\" \"\([^"]*\)\"/\1 \2 \5 \7/' | while read referrer hit; do echo "$hit" >>${STATS}/${referrer}.ips done echo "$i" >>$VISITED_FILES @@ -49,7 +49,7 @@ for month in `cat $MONTHS`; do echo -n "`basename $i .ips` " cat $i | grep "^[^ ]* [0-9]*/$month .*" | sort -u | wc | awk '{ print $1; }' # TODO consider producing an AWStats configuration file for each virtual host name and splitting all new logs into virtual host name-specific log files - done | tee $STATS/unique-ips-days-useragents-per-event-$month - echo "Wrote per-month results to $STATS/unique-ips-days-useragents-per-event-$month" + done | tee $STATS/unique-ips-days-useragents-per-event-`echo $month | tr / -` + echo "Wrote per-month results to $STATS/unique-ips-days-useragents-per-event-`echo $month | tr / -`" done echo "Done at `date`." diff --git a/configuration/unique_ips_per_referrer_generate_month_results_only b/configuration/unique_ips_per_referrer_generate_month_results_only index dcea8f54211..d12bddaa7ae 100755 --- a/configuration/unique_ips_per_referrer_generate_month_results_only +++ b/configuration/unique_ips_per_referrer_generate_month_results_only @@ -11,6 +11,6 @@ for month in `cat $MONTHS`; do cat $i | grep "^[^ ]* [0-9]*/$month .*" | sort -u | wc | awk '{ print $1; }' # TODO consider producing an AWStats configuration file for each virtual host name and splitting all new logs into virtual host name-specific log files done | tee $STATS/unique-ips-days-useragents-per-event-`echo $month | tr / -` - echo "Wrote per-month results to $STATS/unique-ips-days-useragents-per-event-$month" + echo "Wrote per-month results to $STATS/unique-ips-days-useragents-per-event-`echo $month | tr / -`" done echo "Done."