Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust paths to log files in log checking scripts #1933

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions web/scripts/getLogsErrorsETL.sh
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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!

Expand Down
2 changes: 1 addition & 1 deletion web/scripts/getMultipleHbzid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web/scripts/getWebhookCallerLogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading