stack es security query-api-keys cli command
Auth required
Idempotent
Scope: global
elastic stack es security query-api-keys [options]
Find API keys with a query.
--[no-]with-limited-by- Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors (effectively limited by it). An API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has
manage_api_keyor higher privileges. --[no-]with-profile-uid- Determines whether to also retrieve the profile UID for the API key owner principal. If it exists, the profile UID is returned under the
profile_uidresponse field for each API key. --[no-]typed-keys- Determines whether aggregation names are prefixed by their respective types in the response.
--aggregationsstring- Any aggregations to run over the corpus of returned API keys. Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. This supports only a subset of aggregation types, namely:
terms,range,date_range,missing,cardinality,value_count,composite,filter, andfilters. Additionally, aggregations only run over the same subset of fields that query works with. --aggsstring- Any aggregations to run over the corpus of returned API keys. Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. This supports only a subset of aggregation types, namely:
terms,range,date_range,missing,cardinality,value_count,composite,filter, andfilters. Additionally, aggregations only run over the same subset of fields that query works with. --querystring- A query to filter which API keys to return. If the query parameter is missing, it is equivalent to a
match_allquery. The query supports a subset of query types, includingmatch_all,bool,term,terms,match,ids,prefix,wildcard,exists,range, andsimple_query_string. You can query the following public information associated with an API key:id,type,name,creation,expiration,invalidated,invalidation,username,realm, andmetadata. NOTE: The queryable string values associated with API keys are internally mapped as keywords. Consequently, if noanalyzerparameter is specified for amatchquery, then the provided match query string is interpreted as a single keyword value. Such a match query is hence equivalent to atermquery. --fromnumber- The starting document offset. It must not be negative. By default, you cannot page through more than 10,000 hits using the
fromandsizeparameters. To page through more hits, use thesearch_afterparameter. --sortstring-
The sort definition. Other than
id, all public fields of an API key are eligible for sorting. In addition, sort can also be applied to the_docfield to sort by index order.Repeatable: pass
--sortmultiple times to supply more than one value --sizenumber- The number of hits to return. It must not be negative. The
sizeparameter can be set to0, in which case no API key matches are returned, only the aggregation results. By default, you cannot page through more than 10,000 hits using thefromandsizeparameters. To page through more hits, use thesearch_afterparameter. --search-afterstring[]- The search after definition.
--input-filestring- path to a JSON file to use as command input
-V--[no-]version- Print the Elastic CLI version
--config-filestring- path to a config file (default: ~/.elasticrc.yml)
--use-contextstring- override the active context from the config file
--command-profilestring- restrict available commands to a deployment profile (serverless, stack, default)
--[no-]json- output as JSON
--output-fieldsstring- comma-separated list of fields to include in output (dot-notation supported)
--output-templatestring- Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
--[no-]dry-run-
validate all inputs and exit without performing any action (preview changes without applying them)