[Contents] [Prev] [Next] [Index] [Report an Error]


Adding a String to System Log Messages

To add a text string to every system log message directed to a remote machine or to the other Routing Engine, include the log-prefix statement at the [edit system syslog host] hierarchy level:

[edit system syslog host (hostname | other-routing-engine)]
facility severity;
log-prefix string;

The string can contain any alphanumeric or special character except the equal sign (=) and the colon (:). It also cannot include the space character; do not enclose the string in quotation marks (" ") in an attempt to include spaces in it.

A colon and a space are appended to the string when the system log messages are written to the log. The string is inserted after the identifier for the Routing Engine that generated the message.

Example: Adding a String

Add the string M40e to all messages to indicate that the router is an M40e router, and direct the messages to the remote machine hardware-logger.mycompany.com:

[edit system syslog]
host hardware-logger.mycompany.com {
    any info;
    log-prefix M40e;
}

When these configuration statements are included on an M40e router called origin1, a message in the system logging file on hardware-logger looks like the following:

Mar 9 17:33:23 origin1 M40e: mgd[477]: UI_CMDLINE_READ_LINE: user 'root', 
command 'run show version'

[Contents] [Prev] [Next] [Index] [Report an Error]