diff --git a/extract_goaccess_metrics.sh b/extract_goaccess_metrics.sh index d1fcae9..fc2971a 100755 --- a/extract_goaccess_metrics.sh +++ b/extract_goaccess_metrics.sh @@ -21,13 +21,14 @@ addLog(){ metrics(){ LOG_FILE=$1 - geo_err=$( { goaccess "${LOG_FILE}" --log-format="${LOG_FORMAT}" -o "${OUTPUTS_PATH}/${LOG_FILE}_full.json" --json-pretty-print; } 2>&1 ) - python3 goaccess_metric_parser.py -f "${OUTPUTS_PATH}/${LOG_FILE}_full.json" -g 0 + filename=`basename "$LOG_FILE"` + geo_err=$( { goaccess "${LOG_FILE}" --log-format="${LOG_FORMAT}" -o "${OUTPUTS_PATH}/${filename}_full.json" --json-pretty-print; } 2>&1 ) + python3 goaccess_metric_parser.py -f "${OUTPUTS_PATH}/${filename}_full.json" -g 0 status_codes=('200' '204' '404' '500') init="t" - out="${FILTERED_PATH}/${LOG_FILE}" + out="${FILTERED_PATH}/${filename}" for code in "${status_codes[@]}"; do code_logs=$(cat $LOG_FILE| grep -e 'HTTP/[0-9].[0-9]" '${code}' ')