I am trying to fetch old exceptions logs from a application log file in linux. i am trying get the below query result in a variable using php. but getting below exception. Please help.
php code:
$Query= shell_exec (" grep -i -E 'ERROR|exception' applog.log | awk -v ts1="$(date --date=\'1 hours ago\' +\'%d/%m/%y %H:%M:%S.%3N\')" \'$2" "$3 > ts1 {print $0}\'|head -1 ");
Getting below exception:
PHP Parse error: syntax error, unexpected '$' in Exception.php on line 20