ltm rule command HTTP query
iRule(1) BIG-IP TMSH Manual iRule(1)
HTTP::query
Returns or sets the query part of the HTTP request.
SYNOPSIS
HTTP::query (QUERY_STRING)?
DESCRIPTION
Returns or sets the query part of the HTTP request. The query is
defined as the part of the request past a ? character, if any. For the
following URL:
http://www.example.com:8080/main/index.jsp?user=test&login=check The
query is: user=test&login=check
Syntax
HTTP::query
* Returns the query part of the HTTP request.
HTTP::query
* Changes the query part of the HTTP request. Rewriting the URI will only
affect the request to the pool member. The client will not see the
update unless the web application uses the requested URI to
generate response headers and/or content. If you want the client to
see the update to the URI in the browser's address bar, you can
send an HTTP redirect using HTTP::redirect or HTTP::respond.
HTTP::query -normalized
* Returns the query part of the HTTP request normalized in a form
for consistent comparisons.
RETURN VALUE
Returns the query part of the HTTP request.
VALID DURING
HTTP_REQUEST, HTTP_REQUEST_DATA, SERVER_CONNECTED
EXAMPLES
when HTTP_REQUEST {
log local0. "http_path [HTTP::path]"
log local0. "http_query [HTTP::query]"
HTTP::query user=test_user&login=test_login
}
when HTTP_REQUEST {
if {[string tolower [HTTP::query]] contains "utm" || [string tolower [HTTP::query]] contains "gclid"} {
set query [string tolower [HTTP::query]]
}
}
HINTS
SEE ALSO
See HTTP::uri and HTTP::path for other ways to inspect and alter the
URI.
CHANGE LOG
@BIGIP-9.0.0 --First introduced the command. @BIGIP-11.5.0 --Added
ability to modify/set
BIG-IP 2017-01-31 iRule(1)