#!/bin/bash ( cd /var/log/nginx && { cat error.log; cat error.log.1; zcat error*.gz; } | grep 'connect() to unix:/var/run/php/php8.1-fpm.sock failed' | cut -d' ' -f1 | sort | uniq -c )