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.
Example output:
Usage
Command options
-resource
(string: "")
- The type of resource you want to search the cache for. This is a required field. You can search for the following:-query
(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-query
value, 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
token
- A URL that points to a file on disk (file://) from which Boundary reads a token or an environment variable (env://) from which the token will be read. If you set this parameter, it overrides thetoken-name
parameter.token-name
- If specified, Boundary uses the value in this parameter as the name when it stores the token in the system credential store. You can use this value to switch user identities for different commands. You can also specify a token name using the BOUNDARY_TOKEN_NAME environment variable.
CLI options
In addition to the command specific options, there are options common to all CLI commands and subcommands: