From 26daf820d887ebd712030b0d1b62926e4ebc8a29 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 27 Oct 2023 14:59:10 +0200 Subject: [PATCH] Adjust paths to log files in log checking scripts(#1847) --- web/scripts/getLogsErrorsETL.sh | 6 +++--- ...etLogsApplicationFixErrors.sh => getLogsEtlFixErrors.sh} | 6 +++--- web/scripts/getMultipleHbzid.sh | 2 +- web/scripts/getWebhookCallerLogs.sh | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename web/scripts/{getLogsApplicationFixErrors.sh => getLogsEtlFixErrors.sh} (86%) diff --git a/web/scripts/getLogsErrorsETL.sh b/web/scripts/getLogsErrorsETL.sh index 2c126827f..3d166e694 100644 --- a/web/scripts/getLogsErrorsETL.sh +++ b/web/scripts/getLogsErrorsETL.sh @@ -1,6 +1,6 @@ # author: dr0i # -# grep all MapperParsingException in ETL.log and send email +# grep all MapperParsingException in etl.log and send email # see https://github.com/hbz/lobid-resources/issues/1512 MAIL_TO=$(cat .secrets/MAIL_TO) @@ -9,9 +9,9 @@ MAIL_FROM=$(cat .secrets/MAIL_FROM) ERROR_PATTERN="MapperParsingException" if [ -z $1 ]; then - NEWEST_LOG_FN="../logs/application.log" + NEWEST_LOG_FN="../logs/etl.log" else - NEWEST_LOG_FN=$(ls ../application-log*.gz| tail -n1) + NEWEST_LOG_FN=$(ls ../etl-log*.gz| tail -n1) fi diff --git a/web/scripts/getLogsApplicationFixErrors.sh b/web/scripts/getLogsEtlFixErrors.sh similarity index 86% rename from web/scripts/getLogsApplicationFixErrors.sh rename to web/scripts/getLogsEtlFixErrors.sh index 0b35d038f..600fa984f 100644 --- a/web/scripts/getLogsApplicationFixErrors.sh +++ b/web/scripts/getLogsEtlFixErrors.sh @@ -5,9 +5,9 @@ MAIL_TO=$(cat .secrets/MAIL_TO) MAIL_FROM=$(cat .secrets/MAIL_FROM) if [ -z $1 ]; then - NEWEST_LOG_FN=$(ls ../application-log*.gz| tail -n1) + NEWEST_LOG_FN=$(ls ../etl-log*.gz| tail -n1) else - NEWEST_LOG_FN="../logs/application.log" + NEWEST_LOG_FN="../logs/etl.log" fi echo $NEWEST_LOG_FN ERRORS=$(zgrep -v 'replace_all("hbzId",' $NEWEST_LOG_FN | grep -B1 'Error while executing Fix expression') @@ -21,7 +21,7 @@ if [ -n "$ERRORS" ]; then fi echo "$SHORTEND_ERRORS" mail -s "FIX errors in Alma Fix ETL" "${MAIL_TO}" -a "From: ${MAIL_FROM}" << EOF -Getriggert von ausgeführt in $(pwd)/scripts/getLogsApplicationFixErrors.sh : +Getriggert von ausgeführt in $(pwd)/scripts/getLogsEtlFixErrors.sh : Achte auf das Datum der ERROR-Zeilen - evtl. sind das alte Fehler! diff --git a/web/scripts/getMultipleHbzid.sh b/web/scripts/getMultipleHbzid.sh index b0d1e268b..f29575b5c 100644 --- a/web/scripts/getMultipleHbzid.sh +++ b/web/scripts/getMultipleHbzid.sh @@ -7,7 +7,7 @@ MAIL_FROM=$(cat .secrets/MAIL_FROM) SEND_TO_VERBUND=$(cat .secrets/SEND_TO_VERBUND) cd ../ -NEWEST_LOG_FN=$(ls application-log*.gz| tail -n1) +NEWEST_LOG_FN=$(ls etl-log*.gz| tail -n1) echo $NEWEST_LOG_FN HBZIDS=$( zgrep -B2 'java.lang.IllegalStateException: Expected String, got Array' $NEWEST_LOG_FN |grep -B1 'replace_all("hbzId",'| grep hbzId= | sed "s#\(.*\)almaMmsId=\(.*\), id=.*hbzId\(.*\)#\2\3#g" |tr = , |sed "s#\[\(.*\)\].*#\1#g"|sort -u) echo "$HBZIDS" >> $NEWEST_LOG_FN diff --git a/web/scripts/getWebhookCallerLogs.sh b/web/scripts/getWebhookCallerLogs.sh index 6ce2a3bfb..c85e9b53b 100644 --- a/web/scripts/getWebhookCallerLogs.sh +++ b/web/scripts/getWebhookCallerLogs.sh @@ -9,7 +9,7 @@ MAIL_FROM=$(cat .secrets/MAIL_FROM) ERROR_PATTERN="Got response code\|HttpPoster\|notifyWebhook" -NEWEST_LOG_FN="../logs/ETL.log" +NEWEST_LOG_FN="../logs/etl.log" ERRORS=$(grep -B1 "$ERROR_PATTERN" $NEWEST_LOG_FN) DATE=$(date +"%F") ERRORS=$(echo "$ERRORS" | grep $DATE| grep "ERROR\|response code"|grep -v 204)