Skip to content

Commit

Permalink
Changed s3 backup logs
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Oct 14, 2024
1 parent 6f2a5ac commit ffafe04
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions extract_goaccess_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ for log in "$CLUSTER_LOGS_DIR"/*;
do
if [[ $log == *"oscar_oscar"* ]]; then
cp -r $log $LOCAL_LOGS_DIR
# upload a backup of the logs to s3
aws s3 cp --recursive $log s3://metrics.oscar.grycap.net/"${CLUSTER_ID}"/ingresslogs/
# remove total path
log=$(echo $log | sed 's/\/var\/log\/clusterlogs\///')
for logfile in "$LOCAL_LOGS_DIR/$log/oscar/"*;
do
if [[ $logfile == *".gz" ]]; then
# upload a backup of the ingress logs to s3
aws s3 cp $logfile s3://metrics.oscar.grycap.net/"${CLUSTER_ID}"/ingresslogs/
# unzip all log files
gzip -d $logfile
fi
Expand All @@ -75,7 +75,6 @@ for logfile in "$LOCAL_LOGS_DIR/$log/oscar/"*;
do
if [[ $logfile == *".log"* ]]; then
if [[ $logfile == *".log" ]]; then
aws s3 cp $logfile s3://metrics.oscar.grycap.net/"${CLUSTER_ID}"/ingresslogs/
cat $logfile | grep GIN-EXECUTIONS-LOGGER | grep -a '/job\|/run' | tee -a $LATEST_LOGS >/dev/null
metrics $LATEST_LOGS
else
Expand Down

0 comments on commit ffafe04

Please sign in to comment.