Details
-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
Professional Edition
-
None
-
None
Description
While troubleshooting (NX-OS syslog) we noticed that the os_group syslog definitions aren't being processed, manually adding the os_group definitions to the os definitions seems to work for nx-os
// from os definitions
$config['os_group'][$os_group]['syslog_msg'][] = "/: %(?<program>[\w_])-\d-(?<tag>[\w_]):\s(?<msg>.*)/";
// added the fix the issue temporarily
$config['os']['nxos']['syslog_msg'][] = "/: %(?<program>[\w_])-\d-(?<tag>[\w_]):\s(?<msg>.*)/";
Something similar to the following should be added to the process_syslog_line function in order to also process these rules (or merge the rules in a single array beforehand)
if (isset($config['os_group'][$os_group]['syslog_program']) && strlen($entry['program'])) |
{
|
foreach ($config['os_group'][$os_group]['syslog_program'] as $pattern) |
{
|
if (preg_match($pattern, $entry['program'], $matches)) |
{
|
if (OBS_DEBUG) |
{
|
print_cli_table(array(array('syslog program', $entry['program']), array('matched pattern', $pattern)), NULL); |
}
|
// Override founded tag/program references |
if (isset($matches['program'])) { $entry['program'] = $matches['program']; } |
if (isset($matches['tag'])) { $entry['tag'] = $matches['tag']; } |
/* |
// Tags, also allowed multiple tagsX (0-9), started from 0
|
$i = 0;
|
while (isset($matches['tag'.$i]) && $matches['tag'.$i])
|
{
|
$entry['tag'] = rtrim($entry['tag'], ':'); // remove last :
|
$entry['tag'] .= ','.$matches['tag'.$i];
|
$i++;
|
}
|
*/
|
break; // Stop other loop if pattern found |
}
|
}
|
}
|
|