mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Syslog trim whitespace
This commit is contained in:
@@ -115,6 +115,7 @@ function process_syslog($entry, $update) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$entry['program'] = strtoupper($entry['program']);
|
$entry['program'] = strtoupper($entry['program']);
|
||||||
|
$entry = array_map('trim', $entry);
|
||||||
|
|
||||||
if ($update) {
|
if ($update) {
|
||||||
dbInsert(
|
dbInsert(
|
||||||
|
@@ -137,7 +137,7 @@ class SyslogTest extends \PHPUnit_Framework_TestCase
|
|||||||
);
|
);
|
||||||
$testdata[] = $this->createData(
|
$testdata[] = $this->createData(
|
||||||
"1.1.1.1||authpriv||notice||notice||55||2016-02-28 00:23:34|| root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status||sudo",
|
"1.1.1.1||authpriv||notice||notice||55||2016-02-28 00:23:34|| root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status||sudo",
|
||||||
array('device_id'=>1, 'program'=>'SUDO', 'msg'=>' root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status')
|
array('device_id'=>1, 'program'=>'SUDO', 'msg'=>'root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user