I need last 1 minute logs of PHP-fpm for automating alert generation and to use webhooks on other applications. I have used below mentioned command
awk -v d1="$(date --date '-60 min' '+%d/%b/%Y:%T')" '{gsub(/^[[]+/, "", $1);}; $1 > d1' /var/www/logs/php/php7.3-fpm.log | grep "max_children"
but if i replace it to -10000 min it shows all logs in current file. LOG FORMAT IS GIVEN BELOW.
[24-Jan-2021 03:28:09] WARNING: [pool cormier] server reached max_children setting (10), consider raising it
[24-Jan-2021 07:25:34] WARNING: [pool cormier] server reached max_children setting (10), consider raising it
[24-Jan-2021 17:00:52] WARNING: [pool cormier] server reached max_children setting (10), consider raising it
[24-Jan-2021 17:18:07] WARNING: [pool cormier] server reached max_children setting (10), consider raising it
[24-Jan-2021 21:11:06] WARNING: [pool cormier] server reached max_children setting (10), consider raising it
[24-Jan-2021 21:54:27] WARNING: [pool cormier] server reached max_children setting (10), consider raising it
[25-Jan-2021 01:24:12] WARNING: [pool cormier] server reached max_children setting (10), consider raising it
[25-Jan-2021 13:24:12] WARNING: [pool cormier] server reached max_children setting (10), consider raising it```
question from:https://stackoverflow.com/questions/65886455/php-logs-for-last-1-minute