Hi Team,
I need to obtain a list of devices that have syslog enabled as well as those that do not. I have checked the Forward Library and the community but could not find any relevant queries for this purpose. Could you please assist me in generating the list of devices with syslog enabled and those without it? Thank you!
Syslog Enabled devices list
Best answer by Christopher
Syslog server is not a normalized piece of data in Forward Networks.
However, you can look for a pattern in the configuration (or other command output) that has the syslog server.
Different platforms have different syslog configuration, so you would have to parse each type of config based on the vendor and perhaps event OS version.
For example, in the following query, we parse syslog configuration for Cisco and Arista using two different pattern matches, then list the results together in one table.
syslogPatternCisco = ```
logging server {server:string}
```;
syslogPatternArista = ```
logging host {server:string}
```;
getCiscoServers(device) =
foreach match in blockMatches(device.files.config, syslogPatternCisco)
select { serverIP: match.data.server };
getAristaServers(device) =
foreach match in blockMatches(device.files.config, syslogPatternArista)
select { serverIP: match.data.server };
foreach device in network.devices
select {
device: device.name,
vendor: device.platform.vendor,
os: device.platform.os,
servers: if device.platform.vendor == Vendor.CISCO
then (foreach server in getCiscoServers(device)
select server.serverIP)
else if device.platform.vendor == Vendor.ARISTA
then (foreach server in getAristaServers(device)
select server.serverIP)
else ["none"]
}Note that some vendors may not have the syslog configuration as part of the files we collect. For those devices, you may have to use a custom command and parse the data from the custom command output. You could still combine that output into the query above.
Sign up
Already have an account? Login
Welcome to the Forward Networks Community
Select a login option:
Register / Login Forward Employee LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.





