Boundary
search
Command: boundary search
The search command lets you search Boundary's local cache for information about sessions and targets.
For more information, refer to Boundary list vs search.
Examples
The following example searches the local cache for all TCP targets that have the word "Generated" in the name.
$ boundary search -resource targets -query 'type="tcp" and name%"Generated"'
Example output:
Target information:
ID: ttcp_0987654321
Scope ID: p_1234567890
Version: 2
Type: tcp
Name: Generated target using host sources
Description: Provides a target using host sources in Boundary
Authorized Actions:
no-op
read
update
delete
add-host-sources
set-host-sources
remove-host-sources
add-credential-sources
set-credential-sources
remove-credential-sources
authorize-session
ID: ttcp_1234567890
Scope ID: p_1234567890
Version: 1
Type: tcp
Name: Generated target with a direct address
Description: Provides an initial target using an address in Boundary
Address: 127.8.0.1
Authorized Actions:
no-op
read
update
delete
add-host-sources
set-host-sources
remove-host-sources
add-credential-sources
set-credential-sources
remove-credential-sources
authorize-session
Usage
$ boundary search [options]
Command options
-filter=<string>(optional) - If set, the filter operates against each item in the response. We recommend that you use single quotes, because the filters contain double quotes. Refer to the Filtering and listing resources documentation for more details.-max-result-set-size=<int>- Specifies the maximum number of results to return. Set to-1to disable the limit.-query=<string>(optional) - If set, specifies the MQL query you want to use to search for the indexed fields on the resource you specified. If you do not provide a-queryvalue, the search lists all resources of the specified type that have been cached. The available fields that can be used in the search query for each resource include:- targets: id, name, description, type, address, scope_id
- sessions: id, type, endpoint, status, scope_id, target_id, user_id
-resource=<string>- The type of resource you want to search the cache for. This is a required field. You can search for the following:-sort-by=<string>(optional) - If set, specifies the column to sort the search results by. You can configure the following:created_time- Sorts sessions.name- Sorts targets.
-sort-direction=<string>(optional) - If set, specifies which direction to sort the search results:The
sort-byflag is required to specify a sort direction. By default, Boundary sorts search results in ascending order.