选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

PutLoggingConfiguration

聚焦模式
PutLoggingConfiguration - AWS WAFV2
此页面尚未翻译为您的语言。 请求翻译
Note

AWS WAF Classic support will end on September 30, 2025.

This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.

For the latest version of AWS WAF , use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

Associates a LoggingConfiguration with a specified web ACL.

You can access information about all traffic that AWS WAF inspects using the following steps:

  1. Create an Amazon Data Firehose.

    Create the data firehose with a PUT source and in the region that you are operating. However, if you are capturing logs for Amazon CloudFront, always create the firehose in US East (N. Virginia).

    Give the data firehose a name that starts with the prefix aws-waf-logs-. For example, aws-waf-logs-us-east-2-analytics.

    Note

    Do not create the data firehose using a Kinesis stream as your source.

  2. Associate that firehose to your web ACL using a PutLoggingConfiguration request.

When you successfully enable logging using a PutLoggingConfiguration request, AWS WAF will create a service linked role with the necessary permissions to write logs to the Amazon Data Firehose. For more information, see Logging Web ACL Traffic Information in the AWS WAF Developer Guide.

Request Syntax

{ "LoggingConfiguration": { "LogDestinationConfigs": [ "string" ], "RedactedFields": [ { "Data": "string", "Type": "string" } ], "ResourceArn": "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

LoggingConfiguration

The Amazon Data Firehose that contains the inspected traffic information, the redacted fields details, and the Amazon Resource Name (ARN) of the web ACL to monitor.

Note

When specifying Type in RedactedFields, you must use one of the following values: URI, QUERY_STRING, HEADER, or METHOD.

Type: LoggingConfiguration object

Required: Yes

Response Syntax

{ "LoggingConfiguration": { "LogDestinationConfigs": [ "string" ], "RedactedFields": [ { "Data": "string", "Type": "string" } ], "ResourceArn": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

LoggingConfiguration

The LoggingConfiguration that you submitted in the request.

Type: LoggingConfiguration object

Errors

For information about the errors that are common to all actions, see Common Errors.

WAFInternalErrorException

The operation failed because of a system problem, even though the request was valid. Retry your request.

HTTP Status Code: 500

WAFNonexistentItemException

The operation failed because the referenced object doesn't exist.

HTTP Status Code: 400

WAFServiceLinkedRoleErrorException

AWS WAF is not able to access the service linked role. This can be caused by a previous PutLoggingConfiguration request, which can lock the service linked role for about 20 seconds. Please try your request again. The service linked role can also be locked by a previous DeleteServiceLinkedRole request, which can lock the role for 15 minutes or more. If you recently made a DeleteServiceLinkedRole, wait at least 15 minutes and try the request again. If you receive this same exception again, you will have to wait additional time until the role is unlocked.

HTTP Status Code: 400

WAFStaleDataException

The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。