GTAC-Sophia Publish time 2023-7-11 18:24:36

How to filter log information on Ruijie Switch?

Requirements:
The log filtering function can be configured todisplay and record log information of specific types and levels as required
1. Set log filtering directions to terminal and server.
2. Set the log filtering type to filter-only.
3. The filtering rule for logs is Single-match, and the module name contains the SYS logs
Configuration tips:
1. If only the filtering direction and type are configured, but no filtering rules are configured, the log filtering function does not take effect.
2. If only the filtering rules are configured but the filtering direction and type are not configured, the log filtering function takes effect. The filtering direction and type take effect according to the default Settings. By default, logs in all directions are filtered. The filtering type is filter-only.
Configuration steps:
Ruijie#en
1.
Ruijie(config)#logging filter direction server
    Ruijie(config)# logging filter direction termianl
data/attachment/forum/202307/11/182224p49wd9c9dyqcu2ac.png

data/attachment/forum/202307/11/182231vqz0sanp0q8lrtcr.png

all: Filter loginformation in all directions, including the Console direction, VTY terminal,log buffer, log file, and log server
buffer: Filter thelog information of the past log buffer
file: Filter loginformation for past log files
server: Filter thelog information of the previous log server.
terminal: Filter logs to the console and VTY terminals (including Telnet and SSH)
2. logging filter type filter-only
data/attachment/forum/202307/11/182259u37el7e7wb9c6b77.png

data/attachment/forum/202307/11/182307lezwgvzsemm9g9wd.png

Contains-only:Indicates that only logs that contain the keyword information in the filteringrules are output. Logs that do not contain keyword information in the filtering rules are not output.
filter-only: that logs that contain keywords in the filtering rules are filtered out. The filtered logs are not displayed
3. logging filter rule { exact-match module module-name mnemonic mnemonic-name level inform-
level }
logging filter rule single-match { level inform-level |mnemonic mnemonic-name | module module-name }
data/attachment/forum/202307/11/182342dd2givirbi2z2dd7.png

Exact-match: match the exact information
mnemonic mnemonic-name: The mnemonic name of the log information to be filtered.
level inform-level: Level of log information to be filtered. The ranges from 0 to 7.
module module-name: Name of the module to be filtered.
Single-match: match the single information
Exact-metch: filter the log"%LLDP-4-AGEOUTREM: Port Gigabit Ethernet 0/8one neighbor aged out, Chassis ID is 5869.6c33.881e, Port ID is Gi0/33."
data/attachment/forum/202307/11/182407w1jaccjc1rrh8roz.png

Verification:

data/attachment/forum/202307/11/182423pmz33nji88topvvi.png

Pages: [1]
View full version: How to filter log information on Ruijie Switch?