Assign an Alternate Facility
By default, messages directed to a remote machine are handled in the same way as messages belonging to that facility that are generated on the remote machine. For example, suppose you configure the following statements on
local-routerto write messages from theauthorizationfacility to a remote machine calledmonitor:[edit system syslog]host monitor {authorization info;}If the logging utility on
monitoris configured to write messages belonging to theauthorizationfacility to the file/var/log/auth-attempts, the file will contain both the messages generated when users log on tolocal-routerand the messages generated when users log on tomonitor. Although the name of the source machine appears in each system log message, the mixing of messages from multiple machines can still make it more difficult to analyze the contents of theauth-attemptsfile.To assign all messages sent to a remote machine to a different facility on that machine, include the
facility-overridestatement along with thefacilitystatements at the[edit system syslog hosthostname]hierarchy level:[edit system syslog hosthostname]facility level;facility-overridefacility;On the remote machine, you must also configure the logging utility to handle the messages assigned to the alternate facility in the desired manner.
Table 4 lists the system logging facilities that you can specify in the
facility-overridestatement.
Examples: Assign an Alternate Facility
Log all messages generated on the local router at the
errorlevel or higher to thelocal0facility on the remote machine calledmonitor:[edit system syslog]host monitor {any error ;facility-override local0 ;}In the following example, a single remote machine called
central-loggerhandles log messages about configuration changes for two routers located in California and two routers located in New York. The messages from California are aggregated into one facility (local1) and the messages from New York into another facility (local2).[edit system syslog]host central-logger {change-log info ;facility-override local1 ;}[edit system syslog]host central-logger {change-log info ;facility-override local2 ;}On
central-logger, you could then configure the system logging utility to write messages from thelocal1facility to/var/log/california-configand the messages from thelocal2facility to/var/log/new-york-config.