younifyd
Menu

Run an ES|QL query

Run an ES|QL query

POST/_query

Use it in a workflow

  1. Add a step and choose the Elasticsearch connector.
  2. Pick the Run an ES|QL query action (under esql).
  3. Fill in the fields below, then reference the result from later steps as {{runAnEsQlQuery.response.data}}.

Request

Query parameters

formatstring

A short version of the Accept header, e.g. json, yaml. `csv`, `tsv`, and `txt` formats will return results in a tabular format, excluding other metadata fields from the response.

One ofcsvjsontsvtxtyamlcborsmilearrow

delimiterstring

The character to use between values within a CSV row. Only valid for the CSV format.

drop_null_columnsboolean

Should columns that are entirely `null` be removed from the `columns` and `values` portion of the results? Defaults to `false`. If `true` then the response will include an extra section under the name `all_columns` which has the name of all columns.

allow_partial_resultsboolean

If `true`, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards. If `false`, the query will fail if there are any failures. To override the default behavior, you can set the `esql.query.allow_partial_results` cluster setting to `false`.

Request body

Enter the body as JSON in the step's Body field.

columnarboolean

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.

filterany

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.

paramsany

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.

profileboolean

If provided and `true` the response will include an extra `profile` object 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.

querystringrequired

The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.

tablesobject

Tables to use with the LOOKUP operation. The top level key is the table name and the next level key is the column name.

include_ccs_metadataboolean

When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters` object with information about the clusters that participated in the search along with info such as shards count.

Default false

include_execution_metadataboolean

When set to `true`, the response will include an extra `_clusters` object with information about the clusters that participated in the search along with info such as shards count. This is similar to `include_ccs_metadata`, but it also returns metadata when the query is not CCS/CPS

Default false

json
{
  "query": "string",
  "columnar": false,
  "filter": null,
  "time_zone": "string",
  "locale": "string",
  "params": null,
  "profile": false,
  "tables": {},
  "include_ccs_metadata": false,
  "include_execution_metadata": false
}

Response

Returns 200 with an object. Read it in later steps with {{runAnEsQlQuery.response.data.<field>}}.

tookany
is_partialboolean
all_columnsarray<object>
namestringrequired
typestringrequired
columnsarray<object>
namestringrequired
typestringrequired
valuesarray<array<oneOf>>
_clustersany

Cross-cluster search information. Present if `include_ccs_metadata` was `true` in the request and a cross-cluster search was performed.

profileobject

Profiling information. Present if `profile` was `true` in the request. The contents of this field are currently unstable.

json
{
  "columns": [
    {
      "name": "string",
      "type": "string"
    }
  ],
  "values": [
    [
      null
    ]
  ],
  "took": null,
  "is_partial": false,
  "all_columns": [
    {
      "name": "string",
      "type": "string"
    }
  ],
  "_clusters": null,
  "profile": {}
}

Need more? See the Elasticsearch guide for connection setup and behaviour shared by every action.