Configuration Guide Configuring Syslog
The default filtering direction is all, that is, all logs are filtered out.
Run the default logging filter direction command to restore the default filtering direction.
Configuring the Log Filtering Mode
logging filter type { contains-only | filter-only }
contains-only: Indicates that only logs that contain keywords specified in the filtering rules are displayed.
filter-only: Indicates that logs that contain keywords specified in the filtering rules are filtered out and will not
be displayed.
Global configuration mode
Log filtering modes include contains-only and filter-only. The default filtering mode is filter-only.
Configuring the Log Filtering Rule
logging filter rule { exact-match module module-name mnemonic mnemonic-name level level |
single-match { level level | mnemonic mnemonic-name | module module-name } }
exact-match: If exact-match is selected, you must specify all three filtering options.
single-match: If single-match is selected, you may specify only one of the three filtering options.
module module-name: Indicates the module name. Logs of this module will be filtered out.
mnemonic mnemonic-name: Indicates the mnemonic. Logs with this mnemonic will be filtered out.
level level: Indicates the log level. Logs of this level will be filtered out.
Global configuration mode
Log filtering rules include exact-match and single-match.
The no logging filter rule exact-match [ module module-name mnemonic mnemonic-name level level ]
command is used to delete the exact-match filtering rules. You can delete all exact-match filtering rules at a
time or one by one.
The no logging filter rule single-match [ level level | mnemonic mnemonic-name | module
module-name ] command is used to delete the single-match filtering rules. You can delete all single-match
filtering rules at a time or one by one.
Configuration Example
Configuring Syslog Filtering
It is required to configure the syslog filtering function as follows:
1. Set the filtering directions of logs to terminal and server.
2. Set the log filtering mode to filter-only.
3. Set the log filtering rule to single-match to filter out logs that contain the module name "SYS".
Configure the syslog filtering function.