All Products
Search
Document Center

Web Application Firewall:Configure log fields and delivery status

Last Updated:Mar 31, 2026

WAF log service supports two levels of field configuration: default field settings that apply globally to all protected objects, and per-object delivery settings that override the defaults for a specific protected object. Use default field settings when you want a consistent baseline across all objects. Use per-object delivery settings when you need different fields or delivery targets for individual objects.

Prerequisites

Before you begin, ensure that you have:

  • Enabled the log service for your Web Application Firewall (WAF) instance

  • (For external delivery) A WAF 3.0 Enterprise or Ultimate subscription with at least one protected object in hybrid cloud mode

Default field settings

Default field settings define which log fields and log types are collected for all protected objects. Any protected object without a per-object delivery configuration inherits these settings.

To open the default field settings, go to Detection and Response > Log Service, click Log Configuration in the upper-right corner, and select the Default Field Settings tab.

ParameterDescription
Required fieldsAlways included in WAF logs. Cannot be edited. See Required log fields.
Optional fieldsIncluded only when enabled. Enabling more optional fields increases log storage usage. See Optional log fields.
Log typeSelect one or more log types to collect. For each selected log type, set a sampling ratio between 1% and 100%. The sampling ratio controls what percentage of matching requests are recorded.

The three log types are:

  • Block Log: Records requests blocked before reaching the origin server due to security policies, including Block, JS validation, slider verification, and dynamic token protection.

  • Detection Logs: Records requests that trigger observation rules only.

  • Normal Request Logs: Records only logs of normal requests. Logs for requests that pass JS validation, slider verification, and dynamic token verification are also recorded as normal request logs.

Note

For comprehensive auditing and in-depth analysis, select all log storage options to record full logs.

After you complete the configuration, click Save. The Operation Successful message confirms that the settings are applied globally to all protected objects.

Delivery settings

Delivery settings let you configure log fields and delivery targets for a specific protected object. When configured, these settings take priority over the default field settings for that object.

WAF supports two delivery destinations:

  • Simple Log Service (SLS): Available for all protected objects

  • External delivery (Kafka or SYSLOG): Available only for protected objects in hybrid cloud mode on WAF 3.0 Enterprise or Ultimate

Enable or disable SLS delivery

  1. Log on to the WAF 3.0 console. In the top menu bar, select the resource group and region of your WAF instance (Chinese Mainland or Outside Chinese Mainland).

  2. Go to Detection and Response > Log Service.

  3. Click Log Configuration in the upper-right corner, then select the Delivery Settings tab.

  4. In the Status of Delivery to Simple Log Service column, click the switch for the target protected object. A switch that is on (image) indicates that delivery is enabled.

Note

To enable or disable delivery for multiple objects at once, select the protected objects and click Enable Delivery to Simple Log Service or Disable Delivery to Simple Log Service.

Configure SLS delivery fields

On the Delivery Settings tab, click Field Settings in the Field of Delivery to Simple Log Service column for the target protected object. Configure the optional fields, then click OK. The The operation is successful. message confirms that the settings are applied to that protected object.

Configure external delivery

Important

Only protected objects in hybrid cloud mode support external delivery.

Before enabling external delivery for a protected object, add an external delivery configuration:

  1. On the Delivery Settings tab, click Delivery Configurations to open the configuration panel.

  2. If no existing configuration meets your needs, click Configure External Delivery and select a configuration type: SYSLOG or KAFKA.

  3. Complete the configuration using the parameters in the following tables.

SYSLOG configuration

ParameterDescription
Configuration typeSelect SYSLOG.
Configuration nameEnter a name for this configuration.
Server IP/PortEnter the public IPv4 address and port of the server that receives WAF logs.
RFCSelect the RFC definition used by your log management system: RFC 3164 or RFC 5424.
ProtocolSelect TCP or UDP. TCP is suitable for centralized log systems that require reliable delivery with retransmission support. UDP is suitable for high-volume, lower-priority log data where speed takes precedence over delivery guarantees.

Kafka configuration

ParameterDescription
Configuration typeSelect KAFKA.
Configuration nameEnter a name for this configuration.
TOPIC ID/NameEnter the name of the destination Kafka topic.
DomainEnter the cluster endpoint of your Kafka instance. The endpoint can be a domain name and port, or an IP address and port. Separate multiple endpoints with commas. Example: kafka.aliyuncs.com:9093,127.0.0.1:9093,kafka2.aliyuncs.com:9093
Access protocolSelect the security protocol for your Kafka cluster: PLAINTEXT, SASL_PLAINTEXT, or SASL_SSL.
SASL usernameRequired for SASL_PLAINTEXT and SASL_SSL. Enter the username for your Kafka cluster.
SASL passwordRequired for SASL_PLAINTEXT and SASL_SSL. Enter the password for your Kafka cluster.
Compression typeSelect a compression type: gzip, zstd, lz4, snappy, or none.
Custom CARequired for SASL_SSL. Enter the CA certificate content. The certificate must start with -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----.

Enable or disable external delivery

After adding an external delivery configuration, find the protected object on the Delivery Settings tab. Click the switch in the Status of External Delivery column. In the dialog box that appears, select a delivery configuration. A switch that is on (image) indicates that external delivery is enabled.

Note

To enable or disable external delivery for multiple objects at once, select the protected objects and use the Batch Manage bar at the bottom of the list to click Enable External Delivery or Disable External Delivery.

Configure external delivery fields

Important

Only protected objects in hybrid cloud mode support external delivery.

On the Delivery Settings tab, click Field Settings in the Field of External Delivery column for the target protected object. Configure the optional fields and storage type, then click OK. The The operation is successful. message confirms that the settings are applied to that protected object.

What's next

  • Fields in logs: View the full list of required and optional log fields with descriptions.