Fix cisco syslog parsing when logging timestamp is enabled #3203

merged 4 commits into from Mar 10, 2016


None yet

3 participants

murrant commented Mar 9, 2016

I'm not sure if the date format of this can vary much, I put two examples in the tests. One from the ticket and one from the Internet.
Also, a little more cleanup of the syslog unit tests to make them even simpler to add and use a little less memory.

Fixes: #3199

murrant added some commits Mar 9, 2016
@murrant murrant Some devices have "logging timestamp" enabled, try to remove that fro…
…m the start of the message.

Fixes #3199
@murrant murrant Reduce memory cosumption for tests by running one assert at a time ra…
…ther than building all the data then testing.
@murrant murrant Another test case for the cisco syslog timestamp prefix.
@laf laf commented on an outdated diff Mar 9, 2016
@@ -23,6 +23,19 @@ private function createData($line, $resultDelta) {
return $data;
+ /**
+ * Test an input line with the modified fields
+ *
+ * @param string $inputline The line from the syslog daemon including the ||'s
+ * @param array $modified of the modified fields, most likely containging the keys program and msg
+ */
+ private function checkSyslog($inputline, $modified) {
laf Mar 9, 2016 Member

Would you mind just updating this function to use just 4 spaces for indentation.

@laf laf added the Core label Mar 9, 2016
@murrant murrant Fix indentation.
@laf laf merged commit 195f820 into librenms:master Mar 10, 2016

3 checks passed

Auto-Deploy Build finished. No test results found.
Scrutinizer 1 updated code elements
continuous-integration/travis-ci/pr The Travis CI build passed
@murrant murrant deleted the murrant:syslog-issue-3199 branch Mar 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment