The value that you want AWS WAF to search for. AWS WAF searches for the specified string in the part of web
requests that you specified in
FieldToMatch. The maximum length of the value is 50 bytes.
Valid values depend on the values that you specified for
HEADER: The value that you want AWS WAF to search for in the request header that you specified in
FieldToMatch, for example, the value of the
METHOD: The HTTP method, which indicates the type of operation specified in the request. CloudFront
supports the following methods:
QUERY_STRING: The value that you want AWS WAF to search for in the query string, which is the part
of a URL that appears after a
URI: The value that you want AWS WAF to search for in the part of a URL that identifies a resource,
BODY: The part of a request that contains any additional data that you want to send to your web
server as the HTTP request body, such as data from a form. The request body immediately follows the request
headers. Note that only the first
8192 bytes of the request body are forwarded to AWS WAF for
inspection. To allow or block requests based on the length of the body, you can create a size constraint set. For
more information, see CreateSizeConstraintSet.
TargetString includes alphabetic characters A-Z and a-z, note that the value is case sensitive.
If you're using the AWS WAF API
Specify a base64-encoded version of the value. The maximum length of the value before you base64-encode it is 50
For example, suppose the value of
HEADER and the value of
User-Agent. If you want to search the
User-Agent header for the value
BadBot, you base64-encode
BadBot using MIME base64 encoding and include the resulting
QmFkQm90, in the value of
If you're using the AWS CLI or one of the AWS SDKs
The value that you want AWS WAF to search for. The SDK automatically base64 encodes the value.
The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
Users of the SDK should not perform Base64 encoding on this field.
Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
major version of the SDK.