In the "cut -f 3 -d '|'" from what I understand, this only catching the last 3 lines. I adapted to catch the last 20 lines for now. After that it was faster to purge volumes with errors.
How could I adapt the script to pick up all the volumes with error? This way I can create a cron job to regularly check for the wrong volumes.