Fix log entries with timestamps included and incorrect time (leading * or .)

Issue #3316
This commit is contained in:
Tony Murray
2016-04-12 00:05:16 -05:00
parent f1912cca7b
commit 65f929d1f2
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ function process_syslog($entry, $update) {
// multipart message
if(strpos($entry['msg'], ':') !== false) {
$matches = array();
$timestamp_prefix = '([A-Z][a-z]{2} \d\d? \d\d:\d\d:\d\d(.\d\d\d)?( [A-Z]{3})?: )?';
$timestamp_prefix = '([\*\.]?[A-Z][a-z]{2} \d\d? \d\d:\d\d:\d\d(.\d\d\d)?( [A-Z]{3})?: )?';
$program_match = '(?<program>%?[A-Za-z\d\-_]+(:[A-Z]* %[A-Z\d\-_]+)?)';
$message_match = '(?<msg>.*)';
if(preg_match('/^' . $timestamp_prefix . $program_match . ': ?' . $message_match . '/', $entry['msg'], $matches)) {