Technical Documentation

Logging Messages in Structured-Data Format

In JUNOS 8.3 and later, you can log messages to a file in structured-data format instead of the standard JUNOS format. Structured-data format provides more information without adding significant length, and makes it easier for automated applications to extract information from a message.

The structured-data format complies with Internet draft draft-ietf-syslog-protocol-21.txt, The draft establishes a standard message format regardless of the source or transport protocol for logged messages.

To output messages to a file in structured-data format, include the structured-data statement at the [edit system syslog file filename] hierarchy level:

[edit system syslog file filename]
facility severity;
structured-data {
	brief;
}

The optional brief statement suppresses the English-language text that appears by default at the end of a message to describe the error or event. For information about the fields in a structured-data–format message, see Displaying a Log File from a Single-Chassis System.

The structured format is used for all messages logged to the file that are generated by a JUNOS process or software library.

Note: If you include either or both of the explicit-priority and time-format statements along with the structured-data statement, they are ignored. These statements apply to the standard JUNOS system log format, not to structured-data format.


Published: 2010-04-28