- Table of Contents
-
- 14-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System maintenance and debugging commands
- 02-NQA commands
- 03-NTP commands
- 04-PTP commands
- 05-Network synchronization commands
- 06-SNMP commands
- 07-RMON commands
- 08-NETCONF commands
- 09-CWMP commands
- 10-EAA commands
- 11-Process monitoring and maintenance commands
- 12-Sampler commands
- 13-Mirroring commands
- 14-NetStream commands
- 15-IPv6 NetStream commands
- 16-Fast log output commands
- 17-Flow log commands
- 18-Information center commands
- 19-GOLD commands
- 20-Packet capture commands
- 21-Flow monitor commands
- Related Documents
-
Title | Size | Download |
---|---|---|
16-Fast log output commands | 38.63 KB |
Contents
Fast log output commands
customlog format
Use customlog format to enable fast log output.
Use undo customlog format to restore the default.
Syntax
customlog format { cmcc | telecom | unicom }
Default
Fast log output is disabled.
Views
System view
Predefined user roles
network-admin
Parameters
cmcc: Enables fast log output in CMCC format.
telecom: Enables fast log output in TELECOM format.
unicom: Enables fast log output in UNICOM format.
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 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
# Enable fast log output in CMCC format.
[Sysname] customlog format cmcc
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 { cmcc-sessionlog | cmcc-userlog | telecom-sessionlog | telecom-userlog | unicom-sessionlog | unicom-userlog } * [ sysname sysname ]
undo customlog host [ vpn-instance vpn-instance-name ] { hostname | ipv4-address | ipv6 ipv6-address } [ port port-number ]
Default
Fast log output parameters are not configured.
Views
System view
Predefined user roles
network-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.
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.
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.
sysname sysname: Specifies the device name carried in logs, which is a case-sensitive string of 1 to 63 characters. If you do not specify this option, the system name of the device is used in logs.
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 NAT session logs and NAT444 user logs in cmcc format to the log host at 1.1.1.1.
[Sysname] customlog host 1.1.1.1 port 1000 export cmcc-sessionlog cmcc-userlog
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
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 for 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 for 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
Examples
# Configure the timestamp of fast output logs to show the system time.