The firewall log syslog content format command sets the log format to MTN or template for the device to send logs in syslog format.
The undo firewall log syslog content format command restores the default setting.
firewall log syslog content format mtn
firewall log syslog content format template template-name
undo firewall log syslog content format
| Parameter | Description | Value |
|---|---|---|
template template-name |
Specifies the content template name of session logs in syslog format. |
The value is a case-sensitive string of 1 to 32 characters and cannot contain question marks (?) or hyphens (-). If the name contains spaces, the length ranges from 3 to 34 characters, and you must use double quotation marks ("") to enclose it. The template name is set using the session-log template command. |
Logs are in Default format when the device sends logs in syslog format.
A log in the default format contains a keyword and value, such as:
SourceIP=172.16.36.196,DestinationIP=1.1.1.1,SourcePort=4408,DestinationPort=80......
A log in the MTN format contains a complete sentence, such as:
10.1.1.1:4439[1.1.1.1:4439] (trust) to 1.1.1.1:80[10.1.1.1:80] (trust)......
The content of logs outputted in template format is user-defined. You can set keywords, rank keywords, and determine the included keywords. For example:
DestinationIP=1.1.1.1,SourceIP=10.1.1.1,DestinationPort=80......
Different log formats support different types of session logs. For details, see the following table.
Session Log in Syslog Format |
Supported Session Log Types |
|---|---|
Default format |
|
MTN format |
|
User-defined |
|
# Set the log format to MTN when the device sends session logs in syslog format.
<sysname> system-view [sysname] firewall log syslog content format mtn
# Set the content format of session logs to be sent in syslog format to template.
<sysname> system-view [sysname] firewall log syslog content format template test