This section describes how to configure the FW to output service logs in dataflow format to the log server and how to view and analyze service log information on the log server.
system-view
firewall log host host-id ip-address port [ vpn-instance vpn-instance-name ] [ secondary ] [ track ip-link link-name ]
vpn-instance is the name of the VPN instance to which the log host belongs. The VPN instance here indicates one configured with the ip vpn-instance vpn-instance-name command for route isolation. In a virtual system scenario, this command does not allow binding a VPN instance with the same name as the virtual system.
If you set the secondary parameter, the log host belongs to the secondary log host group.
The log hosts of service logs in Dataflow format and session logs are configured with the firewall log host host-id ip-address port command. When service logs are outputted in Dataflow format, the FW uses port 9903 to send logs by default, regardless of the port configured in the log host. To satisfy the needs of sending both service logs in Dataflow format and session logs, you are advised to set the port of the log host to be the same as that of the session log in a specified format. For example, to send session logs in binary format and service logs in Dataflow format, you are advised to set the port to 9002.
firewall log source ip-address port
firewall log password password [ encryption ]
After you run this command, the FW will use the specified encryption password to encrypt the logs before sending. After receiving the binary logs, the log host will use the decryption password to decrypt the logs. This ensures the log transmission security. The encryption password specified on the FW and the decryption password specified on the log host must be the same.
system-view
By default, the function of sending dataflow service logs is disabled.
By default, the function of adding ESN extension headers to service logs in dataflow format is disabled.
dataflow type { traffic [ ipv4 | ipv6 ] | url | content | policy | audit | mail-filtering | av | ips | bwt | aapt | ddos } enable
You can enable the traffic log function as follows: One way is to run the log type traffic enable command. By default, the traffic log function is disabled.
The other way is to enable or disable the traffic log function that matches a security policy under the security policy or default security policy.
Global Traffic Logging |
Security Policy-Specific Traffic Logging |
Whether Traffic Matching a Security Policy Is Logged |
|---|---|---|
Enabled |
Enabled |
Logged |
Enabled |
Disabled |
Not logged |
Enabled |
Not configured |
Logged |
Disabled |
Enabled |
Logged |
Disabled |
Disabled |
Not logged |
Disabled |
Not configured |
Not logged |
For example: Three rules are configured in a security policy: abc1, abc2, and abc3. A user run the log type traffic enable command in system view, the traffic logging disable command under rule abc1 and then the traffic logging enable command under rule abc2. The user does not configure traffic logging for rule abc3. Traffic that matches rule abc1 is not logged, traffic that matches rule abc2 is logged, and traffic that matches rule abc3 is also logged because traffic logging is enabled by default.
log type { url | content | audit | mail-filter | um | threat } enable
By default, the function of recording the preceding types of logs is enabled.
engine log { app-control | audit | av | data-filter | file-block | ips | url-filter } enable
By default, the service log function is enabled.
By default, this function is enabled.
By default, the policy matching log function is disabled.