External Elasticsearch connector
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Preview
Preview
Stack
Planned
Planned
The External Elasticsearch connector calls the Elasticsearch REST API on a remote cluster so an agent can search and explore data, inspect index mappings and aliases, run ES|QL analytics queries, and retrieve cluster information. Use this connector when you need to query data on a separate Elasticsearch cluster — for example, a different Elastic Cloud deployment, a serverless project, an on-prem cluster behind a firewall, or any other cluster that is not directly accessible via cross-cluster search (CCS). The connector can be created from any Kibana deployment (including serverless) and can connect to any Elasticsearch cluster endpoint, whether Elastic Cloud, serverless, or self-managed.
This connector is currently available in Agent Builder only. Workflow support is planned for a future release.
You can create connectors in Stack Management > Connectors.
Elasticsearch connectors have the following configuration properties:
- Elasticsearch URL
- The cluster endpoint URL. For Elastic Cloud, use the Elasticsearch endpoint shown in your deployment in the Elastic Cloud console (for example,
https://my-deployment.es.us-east-1.aws.elastic.cloud). For self-managed clusters, use the full URL including port, for examplehttps://elasticsearch.example.com:9200.
Elasticsearch API key (recommended)
- API Key
- The encoded API key value, which is the base64-encoded
id:api_keystring from the create API key response (POST /_security/api_key). Grant the key at minimum:readprivilege on the indices you search.
Username and password
- Username
- An Elasticsearch user with at minimum
readprivilege on the indices you search. - Password
- The password for that user.
You can test connectors when you create or edit the connector in Kibana. The test calls GET / to verify connectivity and return cluster name and version information.
The Elasticsearch connector has the following actions:
search- Search documents in one or more indices using the Elasticsearch Query DSL. Pass the query in the
queryparameter, with exactly one top-level query type such asmatchorbool; combine clauses withbool. Supports aggregations (aggs), sorting, field filtering (_source), and pagination (size,from). UselistIndicesfirst if you do not know the index name, andgetMappingto understand the available fields. esql- Run an ES|QL query — a pipe-based analytics language optimized for time-series exploration and aggregations. Returns a columnar result set with column names and row values. Requires Elasticsearch 8.11 or later.
listIndices- List indices and data streams with their health, status, document count, and storage size. Optionally filter by name pattern (for example,
logs-*). Use this to discover available indices before callingsearch,getMapping, oresql. getMapping- Retrieve the field mapping for an index: field names, types, and configured analyzers or sub-fields. Use this to understand which fields are available before constructing a query.
request- Make an arbitrary
GETrequest to any Elasticsearch REST API path. Use this as an escape hatch when no typed action covers the endpoint you need — for example,GET /_cluster/health,GET /_alias, orGET /_nodes. The base cluster URL is prepended automatically. getClusterInfo- Get basic information about the cluster: name, version, and build. To check shard/node counts and cluster status, use the
requestaction with path/_cluster/health.
Elasticsearch API key
- Log in to Kibana and go to Stack Management > API Keys.
- Click Create API key.
- Give the key a name and, under Control security privileges, grant at minimum:
readindices privilege on the index patterns you intend to search.
- Click Create API key, then copy the Encoded value.
- Enter the Elasticsearch endpoint URL and the encoded key when configuring the connector in Kibana.
Alternatively, create the key via the API:
POST /_security/api_key{ "name": "kibana-elasticsearch-connector", "role_descriptors": { "connector-role": { "cluster": [], "indices": [ { "names": ["logs-*", "metrics-*"], "privileges": ["read"] } ] } } }
Use the encoded field from the response as the API Key value.
Username and password (self-managed clusters)
- Create a dedicated Elasticsearch user (for example, using the Create or update users API).
- Assign a role granting at minimum
readon the indices you search. - Enter the cluster URL, username, and password when configuring the connector in Kibana.