XML-Formatted Log Messages
Problem
You wish to send your syslog messages in XML format.
Solution
To enable XML-formatted syslog messages, use the following commands:
Router2#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router2(config)#logging console xmlRouter2(config)#logging monitor xmlRouter2(config)#logging buffered xmlRouter2(config)#logging host172.25.1.1xmlRouter2(config)#endRouter2#
Discussion
Beginning with IOS Version 12.2(15)T, Cisco introduced Extensible Markup Language (XML) formatted logging of system events and errors. XML provides a method of standardizing and consistently formatting messages, which can easily be utilized by third-party applications to extract data. When XML logging is enabled, system log messages are tagged using a standardized format. Detailed information regarding the message tagging is contained in Table 18-4.
XML tagging can be enabled on all logging facilities, including console, monitor, buffer, or remote syslog servers. However, XML tagged system messages are not as easily read or understood by humans, which means XML tagged messages are most likely sent to a remote syslog server for processing. For example, here is a typical system message created by a router in normal syslog format:
Jul 15 20:37:17.277 EDT: %SYS-5-CONFIG_I: Configured from console by ijbrown on vty0 (172.25.1.1)
The following is the same system message with XML tagging enabled:
<ios-log-msg><facility>SYS</facility><severity>5</severity><msg-id>CONFIG_I</msg-id><time>Jul ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access