CATEGORY::lookup¶
Description¶
This command returns the category of the supplied URL. If SWG is licensed the URL may take the form
scheme://domain:port/path?query_string#fragment_id
The query_string and fragment_id are optional.
Otherwise the URL should take the form
scheme://domain:port/
(no URI path, query_string, or fragment).
The 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. 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.
Unless the
-display
option is used, a category name returned by this command will have a BIG-IP object path prepended, like
/Common/Financial_Data_and_Services
and
SPACE
characters in category names will be replaced by underscores
'_'
.
By default only system categories are returned. To retrieve both
system and custom categories for some URL append an extra argument
request_default_and_custom
to the command. To retrieve only custom categories append
custom
.
The
-display
option and the custom-categories options only work on TMOS 11.6 and later.
Note: This command requires a feature license such as SWG or URL
Filtering.
To obtain a full list of the system category names that can be
returned, run the following TMSH command:
tmsh list sys url-db url-category | grep url-category | cut -d " " -f4
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"
}