stack es esql async-query cli command
Auth required
elastic stack es esql async-query --query <query> [options]
Run an async ES|QL query.
--querystringrequired- The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.
--[no-]allow-partial-results- If
true, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards. Iffalse, the query will fail if there are any failures. To override the default behavior, you can set theesql.query.allow_partial_resultscluster setting tofalse. --delimiterstring- The character to use between values within a CSV row. It is valid only for the CSV format.
--[no-]drop-null-columns- Indicates whether columns that are entirely
nullwill be removed from thecolumnsandvaluesportion of the results. Iftrue, the response will include an extra section under the nameall_columnswhich has the name of all the columns. --formatstring- A short version of the Accept header, e.g. json, yaml.
csv,tsv, andtxtformats will return results in a tabular format, excluding other metadata fields from the response. For async requests, nothing will be returned if the async query doesn't finish within the timeout. The query ID and running status are available in theX-Elasticsearch-Async-IdandX-Elasticsearch-Async-Is-RunningHTTP headers of the response, respectively. --[no-]columnar- By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.
--filterstring- Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on.
--time-zonestring- Sets the default timezone of the query.
--localestring- Returns results (especially dates) formatted per the conventions of the locale.
--paramsstring[]- To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.
--[no-]profile- If provided and
truethe response will include an extraprofileobject with information on how the query was executed. This information is for human debugging and its format can change at any time but it can give some insight into the performance of each part of the query. --tablesstring- Tables to use with the LOOKUP operation. The top level key is the table name and the next level key is the column name.
--[no-]include-ccs-metadata- When set to
trueand performing a cross-cluster/cross-project query, the response will include an extra_clustersobject with information about the clusters that participated in the search along with info such as shards count. --[no-]include-execution-metadata- When set to
true, the response will include an extra_clustersobject with information about the clusters that participated in the search along with info such as shards count. This is similar toinclude_ccs_metadata, but it also returns metadata when the query is not CCS/CPS --wait-for-completion-timeoutstring- The period to wait for the request to finish. By default, the request waits for 1 second for the query results. If the query completes during this period, results are returned Otherwise, a query ID is returned that can later be used to retrieve the results.
--keep-alivestring- The period for which the query and its results are stored in the cluster. The default period is five days. When this period expires, the query and its results are deleted, even if the query is still ongoing. If the
keep_on_completionparameter is false, Elasticsearch only stores async queries that do not complete within the period set by thewait_for_completion_timeoutparameter, regardless of this value. --[no-]keep-on-completion- Indicates whether the query and its results are stored in the cluster. If false, the query and its results are stored in the cluster only if the request does not complete during the period set by the
wait_for_completion_timeoutparameter.
--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)