- Table of Contents
-
- 17-Network Management and Monitoring Command Reference
- 00-Preface
- 01-Information center commands
- 02-Flow log commands
- 03-Fast log output commands
- 04-NetStream commands
- 05-Cloud connection commands
- 06-Mirroring commands
- 07-Packet capture commands
- 08-NQA commands
- 09-Track commands
- 10-BFD commands
- 11-Monitor Link commands
- 12-Smart Link commands
- 13-Interface backup commands
- 14-Interface collaboration commands
- 15-System maintenance and debugging commands
- 16-NTP commands
- 17-EAA commands
- 18-Process monitoring and maintenance commands
- 19-NETCONF commands
- 20-SNMP commands
- 21-RMON commands
- 22-Event MIB commands
- 23-CWMP commands
- 24-Process placement commands
- Related Documents
-
Title | Size | Download |
---|---|---|
03-Fast log output commands | 75.64 KB |
Contents
Fast log output commands
customlog character-encoding utf-8
Use customlog character-encoding utf-8 to configure fast log output to use the UTF-8 encoding.
Use undo customlog character-encoding to restore the default.
Syntax
customlog character-encoding utf-8
undo customlog character-encoding
Default
Fast log output uses the GB18030 encoding.
Views
System view
Predefined user roles
network-admin
context-admin
Usage guidelines
For the log host to correctly display Chinese characters in received log messages, make sure the fast log output module uses the same character set encoding as the log host. Fast log output supports using GB18030 and UTF-8 encodings.
Examples
# Configure fast log output to use the UTF-8 encoding.
<Sysname> system-view
[Sysname] customlog character-encoding utf-8
customlog format
Use customlog format to enable fast log output.
Use undo customlog format to restore the default.
Syntax
customlog format { aft | aft-cmcc | aft-telecom | aft-unicom | attack-defense | cntm | dns | dpi [ anti-virus | audit | data-filter | file-filter | ips [ sgcc { policy-hit | signature-update } ] | netshare | reputation | sandbox | terminal | traffic-policy | url-filter [ unicom ] | waf ] | keepalive sgcc | lb [ dns-proxy | gslb | inbound | outbound | slb ] | nat { cmcc | telecom | unicom } | packet-filter [ sgcc ] | scd | security-policy sgcc | session | trusted-access { csap | iam [ authorization | notification ] } }
undo customlog format { aft | aft-cmcc | aft-telecom | aft-unicom | attack-defense | cntm | dns | dpi [ anti-virus | audit | data-filter | file-filter | ips | netshare | reputation | sandbox | terminal | traffic-policy | url-filter [ unicom ] | waf ] * | keepalive | lb [ dns-proxy | gslb | inbound | outbound | slb ] * | nat | packet-filter | scd | security-policy | session | trusted-access { csap | iam [ authorization | notification ] } } *
Default
Fast log output is disabled.
Views
System view
Predefined user roles
network-admin
context-admin
Parameters
aft: Enables fast log output for the AFT module.
attack-defense: Enables fast log output for the attack defense module.
dns: Enables fast log output for the DNS module.
dpi: Enables fast log output for a DPI-related module. If you do not specify a DPI module keyword, this command enables fast log output for all the DPI-related modules.
anti-virus: Specifies the anti-virus module.
audit: Specifies the application audit and management module.
reputation: Specifies the IP reputation, domain reputation, and URL reputation modules.
ips: Specifies the intrusion protection system module.
sgcc: Specifies the SGCC format for the specified type of IPS logs. If you do not specify this keyword, the standard format is used for fast output of the IPS logs.
policy-hit: Specifies the IPS policy hit logs.
signature-update: Specifies the IPS signature update logs.
netshare: Specifies the netshare control module.
sandbox: Specifies the sandbox module.
traffic-policy: Specifies the bandwidth management module.
url-filter: Specifies the URL filtering module.
unicom: Specifies the UNICOM format for fast output URL filtering logs. If you do not specify this keyword, the standard format is used to output the logs.
waf: Specifies the Web application firewall module.
keepalive: Enables fast log output of keepalive logs. After this keyword is specified, the device sends keepalive logs to the log host periodically. If the log host cannot receive the keepalive logs in a specific period of time, the log host determines that the device is down.
lb: Enables fast log output for a load balancing module. If you do not specify a load balancing module, this command enables fast log output for all load balancing modules.
· dns-proxy: Specifies the transparent DNS proxy module.
· gslb: Specifies the global load balancing module.
· inbound: Specifies the inbound link load balancing module.
· outbound: Specifies the outbound link load balancing module.
· slb: Specifies the server load balancing module.
nat: Enables fast log output in a specific format for the NAT module.
· cmcc: Specifies the CMCC format.
· telecom: Specifies the TELECOM format.
· unicom: Specifies the UNICOM format.
packet-filter: Enables fast output of packet matching logs for the packet filter and security policy modules.
scd: Enables fast log output for the service connection detection module.
security-policy: Enables fast output of security policy configuration logs for the security policy module.
session: Enables fast log output for the session management module.
sgcc: Specifies the SGCC format for the specified type of logs. If you do not specify this keyword, the standard format is used for fast output of the logs.
Usage guidelines
The fast log output feature enables fast output of logs to log hosts.
Typically, logs generated by a service module are first sent to the information center, which then outputs the logs to the specified destination (such as to log hosts). When fast log output is configured, logs of service modules are sent directly to log hosts instead of to the information center. Compared to outputting logs to the information center, fast log output saves system resources.
Fast log output, flow log, and information center are exclusive from one another. When the customlog format command is configured, the specified service module uses only the fast log output method. For more information about flow log, see "Configuring flow log." For more information about the information center, see "Configuring the information center."
To output logs of the NAT module to a log host, you must specify the log format required by the log host in the customlog format and customlog host commands. Logs of other modules can be output only in one format. You do not need to specify the format for these logs.
Examples
# Enable fast log output for the session management module.
[Sysname] customlog format session
customlog host
Use customlog host to configure fast log output parameters.
Use undo customlog host to remove the fast log output configuration.
Syntax
customlog host [ vpn-instance vpn-instance-name ] { hostname | ipv4-address | ipv6 ipv6-address } [ port port-number ] export { aft | attack-defense | cmcc-sessionlog | cmcc-userlog | dns | dpi [ anti-virus | audit | ips | netshare | reputation | sandbox | traffic-policy | url-filter | waf ] * | keepalive | lb [ dns-proxy | gslb | inbound | outbound | slb ] *| packet-filter | scd | security-policy | session | telecom-sessionlog | telecom-userlog | unicom-sessionlog | unicom-userlog } *
undo customlog host [ vpn-instance vpn-instance-name ] { hostname | ipv4-address | ipv6 ipv6-address } [ port port-number ]
Fast log output parameters are not configured.
Views
System view
Predefined user roles
network-admin
context-admin
Parameters
vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the log host belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the log host is on the public network, do not specify this option.
hostname: Specifies a log host by its name, a case-insensitive string of 1 to 253 characters. The host name can contain letters, digits, hyphens (-), underscores (_), and dots (.).
ipv4-address: Specifies a log host by its IPv4 address.
ipv6 ipv6-address: Specifies a log host by its IPv6 address.
port port-number: Specifies the port number of the log host. The value range is 1 to 65535, and the default is 514. The setting must be the same as the port number configured on the log host. Otherwise, the log host cannot receive logs.
export: Specifies a source module for fast log output.
aft: Outputs logs of the AFT module to the log host.
attack-defense: Outputs logs of the attack defense module to the log host.
cmcc-sessionlog: Outputs NAT session logs in CMCC format to the log host.
cmcc-userlog: Outputs NAT444 user logs in CMCC format to the log host.
dns: Outputs DNS logs to the log host.
dpi: Outputs logs of a DPI-related module to the log host. If you specify the dpi keyword without a DPI module keyword, this command outputs logs of all the DPI-related modules to the log host.
anti-virus: Specifies the anti-virus module.
audit: Specifies the application audit and management module.
reputation: Specifies the IP reputation, domain repuation, and URL reputation modules.
ips: Specifies the intrusion protection system module.
netshare: Specifies the netshare control module.
sandbox: Specifies the sandbox module.
traffic-policy: Specifies the bandwidth management module.
url-filter: Specifies the URL filtering module.
waf: Specifies the Web application firewall module.
keepalive: Outputs keepalive logs to the log host.
lb: Outputs logs of a load balancing module to the log host. If you do not specify a load balancing module, this command outputs logs of all load balancing modules to the log host.
· dns-proxy: Specifies the transparent DNS proxy module.
· gslb: Specifies the global load balancing module.
· inbound: Specifies the inbound link load balancing module.
· outbound: Specifies the outbound link load balancing module.
· slb: Specifies the server load balancing module.
packet-filter: Outputs packtet matching logs of the packet filter and security policy modules to the log host.
scd: Outputs logs of the server connection detection module to the log host.
security-policy: Outputs security policy configuration logs of the security policy module to the log host.
session: Outputs logs of the session management module to the log host.
telecom-sessionlog: Outputs NAT session logs in TELECOM format to the log host.
telecom-userlog: Outputs NAT444 user logs in TELECOM format to the log host.
unicom-sessionlog: Outputs NAT session logs in UNICOM format to the log host.
unicom-userlog: Outputs NAT444 user logs in UNICOM format to the log host.
Usage guidelines
The customlog host command takes effect only after the customlog format command is configured.
To output NAT logs to a log host, you must specify the log format required by the log host in the customlog format and customlog host commands.
Examples
# Output logs of the session management module to the log host at 1.1.1.1.
[Sysname] customlog host 1.1.1.1 port 1000 export session
customlog host source
Use customlog host source to specify a source IP address for fast log output.
Use undo customlog host source to restore the default.
Syntax
customlog host source interface-type interface-number
Default
The source IP address of fast output logs is the primary IP address of the outgoing interface.
Views
System view
Predefined user roles
network-admin
context-admin
Parameters
interface-type interface-number: Specifies a source interface by its type and number. The interface's primary IP address will be used as the source IP address of fast output logs.
Usage guidelines
Configure this command when you need to filter logs according to their source IP addresses on the log host.
The customlog host source command takes effect only after the customlog format and customlog host commands are configured.
Examples
# Use the IP address of Loopback 0 as the source IP address of fast output logs.
[Sysname] interface loopback 0
[Sysname-LoopBack0] ip address 2.2.2.2 32
[Sysname-LoopBack0] quit
[Sysname] customlog host source loopback 0
customlog timestamp
Use customlog timestamp localtime to configure the timestamp of fast output logs to show the system time.
Use undo customlog timestamp localtime to restore the default.
Syntax
undo customlog timestamp localtime
Default
The timestamp of fast output logs shows the Greenwich Mean Time (GMT).
Views
System view
Predefined user roles
network-admin
context-admin
Examples
# Configure the timestamp of fast output logs to show the system time.
[Sysname] customlog timestamp localtime
customlog with-sn
Use customlog with-sn to configure the device to carry its serial number in fast output logs.
Use undo customlog with-sn to restore the default.
Syntax
customlog with-sn
undo customlog with-sn
The following compatibility matrix shows the support of hardware platforms for this command:
F1000 series |
Models |
Command compatibility |
F1000-X-G5 series |
F1000-A-G5, F1000-C-G5, F1000-C-G5-LI, F1000-E-G5, F1000-H-G5, F1000-S-G5 |
No |
F1000-X-G3 series |
F1000-A-G3, F1000-C-G3, F1000-E-G3, F1000-S-G3 |
No |
F1000-X-G2 series |
F1000-A-G2, F1000-C-G2, F1000-E-G2, F1000-S-G2 |
No |
F1000-9X0-AI series |
F1000-9390-AI, F1000-9385-AI, F1000-9380-AI, F1000-9370-AI, F1000-9360-AI, F1000-9350-AI, F1000-9330-AI, F1000-9320-AI, F1000-990-AI, F1000-980-AI, F1000-970-AI, F1000-960-AI, F1000-950-AI, F1000-930-AI, F1000-920-AI , F1000-910-AI, F1000-905-AI |
No |
F1000-C83X0 series |
F1000-C8395, F1000-C8390, F1000-C8385, F1000-C8380, F1000-C8370, F1000-C8360, F1000-C8350, F1000-C8330 |
Yes |
F1000-C81X0 series |
F1000-C8180, F1000-C8170, F1000-C8160, F1000-C8150, F1000-C8130, F1000-C8120, F1000-C8110 |
Yes |
F1000-7X0-HI series |
F1000-770-HI, F1000-750-HI, F1000-740-HI, F1000-730-HI, F1000-720-HI, F1000-710-HI |
No |
F1000-C-X series |
F1000-C-EI, F1000-C-HI, F1000-C-XI, F1000-E-XI |
No |
F1000-V series |
F1000-E-VG, F1000-S-VG |
No |
SecBlade IV |
LSPM6FWD8, LSQM2FWDSC8 |
No |
F100 series |
Models |
Command compatibility |
F100-X-G5 series |
F100-A-G5, F100-C-G5, F100-E-G5, F100-M-G5, F100-S-G5 |
No |
F100-X-G3 series |
F100-A-G3, F100-C-G3, F100-E-G3, F100-M-G3, F100-S-G3 |
No |
F100-X-G2 series |
F100-A-G2, F100-C-G2, F100-E-G2, F100-M-G2, F100-S-G2 |
No |
F100-WiNet series |
F100-A80-WiNet, F100-C80-WiNet, F100-C60-WiNet, F100-C50-WiNet, F100-S80-WiNet, F100-A81-WiNet, F100-A91-WiNet |
No |
F100-C-A series |
F100-C-A6, F100-C-A5, F100-C-A3, F100-C-A6-WL, F100-C-A5-W, F100-C-A3-W |
No |
F100-X-XI series |
F100-A-EI, F100-A-HI, F100-A-SI, F100-C-EI, F100-C-HI, F100-C-XI, F100-E-EI, F100-S-HI, F100-S-XI |
No |
Default
The device does not carry its serial number in fast output logs.
Views
System view
Predefined user roles
network-admin
context-admin
Usage guidelines
This feature enables a device to add a serial number (SN) field to fast output log messages, helping users to identify the devices that sent the log messages.
This feature is not applicable to fast output logs in TELECOM, CMCC, and UNICOM formats.
Examples
# Configure the device to carry its serial number in fast output logs.
<Sysname> system-view
[Sysname] customlog with-sn