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


Prepend a Prefix

To prepend a string to every system log message sent to a remote machine, include the log-prefix statement along with the facility statements at the [edit system syslog host hostname ] hierarchy level:

[edit system syslog host hostname]
facility level ;
log-prefix string ;

The log-prefix string can contain any alphanumeric character other than a space, the equal sign ( = ), or the colon ( : ). A colon and a space are appended to the string when the system log messages are written to the log.

Example: Prepend a Prefix

Prepend the string M40 to all messages generated on the router to indicate that the router is an M40, and send the messages to the remote machine hardware-logger:

[edit system syslog]
host hardware-logger {
    any info;
    log-prefix M40 ;
}

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

Mar 9 17:33:23 original1 M40: mgd[477]: UI_CMDLINE_READ_LINE: user `root', command `run 
show version'

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