Fortinet white logo
Fortinet white logo

Script Reference Guide

HTTP:payload(find)

HTTP:payload(find)

Searches for a particular string or a regular expression on the buffered data.

Syntax

HTTP:payload(t);

Arguments

Name Description

t

A table which specifies the parameters: data, offset, size, scope.

Events

Applicable in the following events:

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

Example

when HTTP_DATA_REQUEST {
t={};
t[“operation”]=”find”
t[“data”]=”sth”; -- can be a regular expression, like (s.h)
t[“offset”]=12;
t[“size”]=20;
t[“scope”]=”first” -- the scope field can be either “first” or “all”
ct = HTTP:payload(t);  --return value is a boolean false if operation fail or the number of occurrences found;
}

Note: The “offset” and “size” fields are optional. If the “offset” field is missing, zero is assumed. If the “size” field is missing, it will operate on the whole buffered data. The “scope” field can be either be “first” or “all”.

Supported Version

FortiADC version 4.8.x and later.

HTTP:payload(find)

HTTP:payload(find)

Searches for a particular string or a regular expression on the buffered data.

Syntax

HTTP:payload(t);

Arguments

Name Description

t

A table which specifies the parameters: data, offset, size, scope.

Events

Applicable in the following events:

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

Example

when HTTP_DATA_REQUEST {
t={};
t[“operation”]=”find”
t[“data”]=”sth”; -- can be a regular expression, like (s.h)
t[“offset”]=12;
t[“size”]=20;
t[“scope”]=”first” -- the scope field can be either “first” or “all”
ct = HTTP:payload(t);  --return value is a boolean false if operation fail or the number of occurrences found;
}

Note: The “offset” and “size” fields are optional. If the “offset” field is missing, zero is assumed. If the “size” field is missing, it will operate on the whole buffered data. The “scope” field can be either be “first” or “all”.

Supported Version

FortiADC version 4.8.x and later.