Product Documentation

Expression Prefixes for Text in HTTP Requests and Responses

Oct 19, 2016

An HTTP request or response typically contains text, such as in the form of headers, header values, URLs, and POST body text. You can configure expressions to operate on one or more of these text-based items in an HTTP request or response.

The following table describes the expression prefixes that you can configure to extract text from different parts of an HTTP request or response.



Table 1. HTTP Expression Prefixes That Return Text

Prefix

Description

HTTP.REQ.BODY(<integer>)

Example: HTTP.REQ.BODY(100)

It will return first 100 characters of HTTP Request body. If the length of body is less than 100 then whole body will result as output.

HTTP.REQ.HOSTNAME

 Example: HTTP.REQ.HOSTNAME.EQ("abc.com”)

The above example returns true if hostname is abc.com. It returns HTTP Host Name object from this request. If the target hostname is present in the first line of the request then that is selected. Otherwise the value in the last occurrence of the HOST header is selected. The format of output is abc.foo.com:8080.

For more information on typecasting, see "Typecasting Data."

HTTP.REQ.HOSTNAME. DOMAIN

Example: HTTP.REQ.URL.HOSTNAME.DOMAIN.EQ("foobar.com")

The above example returns true if domain name is foobar.com. It returns Domain name part of the hostname. If the hostname is www.foobar.com or www.foobar.com:8080, then domain is foobar.com.

HTTP.REQ.HOSTNAME. SERVER

Example: HTTP.REQ.URL.HOSTNAME.SERVER.EQ("www.foobar.com")

The above example returns true if server name is www.foobar.com. It returns Domain name part of the hostname. If the hostname is www.foobar.com or www.foobar.com:8080, then domain is www.foobar.com.

HTTP.REQ.METHOD

Example: HTTP.REQ.HOSTNAME.SERVER(“www.foobar.com”)

The above example returns true if domain name is www.foobar.com. Correct one is HTTP.REQ.HOSTNAME.SERVER. It returns Domain name part of the hostname.

HTTP.REQ.URL

Example: HTTP.REQ.URL.EQ("http://www.google.com")

The above example returns true if domain name is http://www.google.com. It returns the HTTP URL object from request.

HTTP.REQ.URL.HOSTNAME

Example: HTTP.REQ.URL.HOSTNAME.EQ("abc.foo.com:8080")

The above example returns true if hostname in URL is abc.foo.com:8080. It returns HTTP Host Name present in the URL.

For more information on typecasting, see "Typecasting Data."

HTTP.REQ.URL.HOSTNAME.DOMAIN

Example: HTTP.REQ.URL.HOSTNAME.DOMAIN.EQ("foobar.com")

The above example returns true if domain name is foobar.com. It returns Domain name part of the hostname. If the hostname is www.foobar.com or www.foobar.com:8080, then domain is foobar.com. 

HTTP.REQ.URL.HOSTNAME.SERVER

Example:

The above example returns true if server name is www.foobar.com. It returns Domain name part of the hostname.  If the hostname is www.foobar.com or www.foobar.com:8080, then domain is www.foobar.com

HTTP.REQ.URL.HOSTNAME.PORT

Example: HTTP.REQ.URL.HOSTNAME.PORT.EQ(80)

The above example returns true if port is 80. It returns number on the port part of the hostname.

HTTP.REQ.URL.PATH

Example:HTTP.REQ.URL.PATH.GET(1)

If the URL is http://www.foo.com/a/b/c/bar.html?a=1 then operation will select /a/b/c/bar.html, then the above example will result in “a”. It returns / separated List on the path component of the URL.

HTTP.REQ.URL.PATH_AND_QUERY

Example: HTTP.REQ.URL.PATH_AND_QUERY

If the URL is http://www.foo.com/a/b/c/bar.html?a=1 then it will return /a/b/c/bar.html?a=1. It returns the portion of the URL following the hostname

HTTP.REQ.URL.PROTOCOL

Example: HTTP.REQ.URL.PROTOCOL

If the URL is http://www.foo.com/a/b/c/bar.html?a=1 then operation will result in HTTP. It results in the protocol present in the URL.

HTTP.REQ.URL.QUERY

Example: HTTP.REQ.URL.QUERY

If the URL is http://www.foo.com?abc=1&def=2 will result in abc=1&def=2. It results as Name-Value List (with delimiters = and &) on the query component of the URL.

HTTP.REQ.URL.QUERY.VALUE

Example: -NA-

It returns the value component of the specified name-value component in the list.

HTTP.REQ.URL.SUFFIX

Example: HTTP.REQ.URL.SUFFIX

If the path is /a/b/c.html then this operation will result html.  It returns filename suffice of the URL.

HTTP.REQ.USER

Example: HTTP.REQ.USER.GROUPS('grp1:grp2')

The above example will return list on the Group which is separated by given delimiter I.e. “:" It returns the AAA User associated with the current HTTP transaction.

HTTP.REQ.USER.EXTERNAL_GROUPS

Example: HTTP.REQ.USER.EXTERNAL_GROUPS

The above example will list external groups which are separated by “,". IT returns list of external groups which is separated by “,".

HTTP.REQ.USER.EXTERNAL_GROUPS.IGNORE_EMPTY_ELEMENTS

Example: HTTP.REQ.USER.EXTERNAL_GROUPS. IGNORE_EMPTY_ELEMENTS.COUNT

If AAA User associated with the current HTTP transaction is part of some external groups : 123,,24, ,15 then HTTP.REQ.USER.EXTERNAL_GROUPS. IGNORE_EMPTY_ELEMENTS.COUNT gives 4, whereas HTTP.REQ.USER.EXTERNAL_GROUPS.COUNT gives 5. It ignores empty elements in the list.

HTTP.REQ.USER.EXTERNAL_GROUPS(sep)

Example: HTTP.REQ.USER.EXTERNAL_GROUPS(“:”)

The above example will list external groups which are separated by “:” It returns list of external groups which is separated by given delimiter.

HTTP.REQ.USER.GROUPS

Example: HTTP.REQ.USER.GROUPS

The above example will list groups which are separated by “,". IT returns list of groups which is separated by “,".

HTTP.REQ.USER.GROUPS.IGNORE_EMPTY_ELEMENTS

Example: HTTP.REQ.USER.GROUPS. IGNORE_EMPTY_ELEMENTS.COUNT

If AAA User associated with the current HTTP transaction is part of some groups : 123,,24, ,15 then HTTP.REQ.USER.GROUPS. IGNORE_EMPTY_ELEMENTS.COUNT gives 4, whereas HTTP.REQ.USER.GROUPS.COUNT gives 5. It ignores empty elements in the list.

HTTP.REQ.USER.GROUPS(sep)

Example: HTTP.REQ.USER.GROUPS(“:”)

The above example will list groups which are separated by “:" IT returns list of groups which is separated by given delimiter.

HTTP.REQ.USER.INTERNAL_GROUPS

Example: HTTP.REQ.USER.INTERNAL_GROUPS

The above example will list internal groups which are separated by “,". IT returns list of internal groups which is separated by “,".

HTTP.REQ.USER.INTERNAL_GROUPS.IGNORE_EMPTY_ELEMENTS

Example: HTTP.REQ.USER.INTERNAL_GROUPS. IGNORE_EMPTY_ELEMENTS.COUNT

If AAA User associated with the current HTTP transaction is part of some internal groups : 123,,24, ,15 then HTTP.REQ.USER.INTERNAL_GROUPS.IGNORE_EMPTY_ELEMENTS.COUNT gives 4,  whereas HTTP.REQ.USER.INTERNAL_GROUPS.COUNT gives 5. It ignores empty elements in the list.

HTTP.REQ.USER.INTERNAL_GROUPS(sep)

Example: HTTP.REQ.USER.INTERNAL_GROUPS(“:”)

The above example will list internal groups which are separated by “:" IT returns list of internal groups which is separated by given delimiter.

HTTP.REQ.USER.IS_MEMBER_OF(group_name)

Example: HTTP.REQ.USER.IS_MEMBER_OF(grp1)

The above example returns true is the current AAA user is member of group grp1. It returns TRUE if the user is a member of the group group_name.

HTTP.REQ.USER.NAME

Example: HTTP.REQ.USER.NAME

The above example will return name of the user. It returns the name of user. This is the name used by user for login unless it is overridden by name from external authentication server.

HTTP.REQ.USER.PASSWD

Example: HTTP.REQ.USER.PASSWD

The above example will return password of the user.  It returns the password of user.

HTTP.REQ.VERSION

Example: HTTP.REQ.VERSION

The above example returns HTTP version information.

HTTP.RES.BODY(<integer>)

Example: HTTP.RES.BODY(100)

It will return first 100 characters of HTTP Response body. If the length of body is less than 100 then whole body will result as output.

HTTP.RES.STATUS_MSG

Example: HTTP.RES.STATUS_MSG

The above example results status message of response. It can be “Done”, some error etc.

HTTP.RES.VERSION

Example: HTTP.RES.VERSION

The above example returns HTTP version information.

HTTP.REQ.URL.HOSTNAME.EQ(<hostname>)

 Example: HTTP.REQ.URL.HOSTNAME.EQ("abc.foo.com:8080")

The above example returns true if hostname in URL is abc.foo.com:8080. It returns HTTP Host Name present in the URL.

HTTP.REQ.IS_NTLM_OR_NEGOTIATE

Example: HTTP.REQ.IS_NTLM_OR_NEGOTIATE

The above example returns TRUE if request is part of NTLM or NEGOTIATE connection.

HTTP.REQ.URL.PATH.IGNORE_EMPTY_ELEMENTS

Example: HTTP.REQ.URL.PATH. IGNORE_EMPTY_ELEMENTS.COUNT

If request URL has path (/123//24//15) elements as : 123,,24, ,15 then HTTP.REQ.URL.PATH.IGNORE_EMPTY_ELEMENTS.COUNT gives 4, whereas HTTP.REQ.URL.PATHS.COUNT gives 5. It ignores empty elements in the list.

HTTP.REQ.URL.QUERY.IGNORE_EMPTY_ELEMENTS

Example: HTTP.REQ.URL.QUERY.IGNORE_EMPTY_ELEMENTS.COUNT

If request URL has path as : abc=1&&def=2&g=3&h=6 then HTTP.REQ.URL.QUERY.IGNORE_EMPTY_ELEMENTS.COUNT gives 4, whereas HTTP.REQ.URL.QUERY.COUNT gives 5. It ignores empty elements in the list.