ltm rule command CATEGORY lookupΒΆ

iRule(1)						BIG-IP TMSH Manual						  iRule(1)

CATEGORY::lookup
       Get category of URL.

SYNOPSIS
       CATEGORY::lookup URL ('-display' | '-id')? ('custom' | 'request_default' | 'request_default_and_custom')? ('-ip' IP)?
       ('-custom_cat_match' ANY_CHARS)?

DESCRIPTION
       This command returns the category of the supplied URL. (requires SWG license) The URL needs to be of the form:
       scheme://domain:port/path?query_string#fragment_id

       The query_string and fragment_id are optional. The entire list of categories supported is available in the UI under "Secure
       Web Gateway" in the APM section. Examples of categories include Sports, Shopping, etc. The response is a list of category
       names in a TCL array. Most input URLs result in a single category but some will return more than one. Additionally, a
       result of "199" indicating a recommendation to scan the response can also be returned.

       To obtain a full list of the category names that can be returned, run the following TMSH command: tmsh list sys url-db url-
       category | grep url-category | cut -d " " -f4

       -custom_cat_match will allow lookup of the URL in one specified custom category. To see a list of custom categories to
       choose from, run the following TMSH command: tmsh list sys url-db url-category one-line | grep "is-custom true" | cut -d "
       " -f4

RETURN VALUE
       Returns a list of categories returned by the categorization engine depending on the category type specified (custom,
       request_default, or request_default_and_custom). If no type is specified, it will return request_default. If the "-display"
       flag is used, it will return the string with category only, otherwise it will return the string as a category name with the
       partition to which it belongs.

VALID DURING
EXAMPLES
	when HTTP_REQUEST {
	    set this_uri http://[HTTP::host][HTTP::uri]
	    set reply [CATEGORY::lookup $this_uri]
	    log local0. "Category lookup for $this_uri give $reply"
	}

HINTS
       Requires SWG license

SEE ALSO
CHANGE LOG
       @BIGIP-11.5.0
	   --First introduced the command.

BIG-IP							    2022-04-12							  iRule(1)