Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1138,4 +1138,12 @@ redirects:
anchors:
'attacks-next-steps': 'manage-saved-discoveries'
'solutions/security/ai/triage-attack-discovery-findings.md': 'solutions/security/ai/attack-discovery/triage-attack-discovery-findings.md'

# related to https://github.com/elastic/docs-content/issues/7709
'solutions/elasticsearch-solution-project/search-connection-details.md':
to: 'solutions/elasticsearch-solution-project/search-connection-details.md'
anchors:
'_elastic_cloud_and_self_hosted_deployments': 'find-endpoint-cloud-self-managed'
'_serverless_deployments': 'find-endpoint-cloud-self-managed'
'find-cloud-id-serverless': 'find-endpoint-cloud-self-managed'
'create-an-api-key-serverless': 'create-an-api-key-cloud-self-managed'

184 changes: 110 additions & 74 deletions solutions/elasticsearch-solution-project/search-connection-details.md
Original file line number Diff line number Diff line change
@@ -1,136 +1,172 @@
---
navigation_title: Find connection details
description: Find your Elasticsearch endpoint and create an API key so that client applications and tools can connect to your cluster or project.
mapped_pages:
- https://www.elastic.co/guide/en/kibana/current/search-space-connection-details.html
applies_to:
stack:
Comment thread
charlotte-hoblik marked this conversation as resolved.
deployment:
ech:
ece:
eck:
self:
serverless:
products:
- id: kibana
- id: elasticsearch
type: how-to
---

# Find connection details [search-space-connection-details]

To connect a client application or a third-party tool to {{es}}, you need two things: the {{es}} endpoint URL, and credentials that authenticate the request. For secure connections, use an API key.

To connect to your {{es}} deployment, you need your {{es}} endpoint URL. For secure connections, we recommend using an API key for authentication.
## Before you begin [before-you-begin]

The following sections describe how to find your Cloud ID and create API keys in both {{ecloud}} and {{serverless-short}} deployments.
To create an API key, you need the `manage_api_key` or the `manage_own_api_key` cluster privilege.

## Elastic Cloud and self-hosted deployments [_elastic_cloud_and_self_hosted_deployments]
## Find your {{es}} endpoint [find-endpoint-cloud-self-managed]

### Find your {{es}} endpoint [find-endpoint-cloud-self-managed]
:::::{applies-switch}

Elastic recommends you connect client applications to your cluster using standard URLs.
::::{applies-item} { "deployment": { "ech": "ga", "ece": "ga" }, "serverless": "ga" }
Your endpoint is in the **Connection details** panel in {{kib}}.

1. Go to the {{ecloud}} home page.
2. In the main menu, select **Manage this deployment**.
3. Under the **Applications** list, select **Copy endpoint** next to **{{es}}**.
1. Open {{kib}} for your deployment or project.
2. From the **Help menu** {icon}`question`, select **Connection details**.
3. Copy the **{{es}} endpoint** from the **Endpoints** tab.

### Find your Cloud ID [find-cloud-id-cloud-self-managed]
:::{image} /solutions/images/kibana-connection-details-endpoints.png
:alt: The Connection details panel showing the Elasticsearch endpoint on the Endpoints tab, with the Show Cloud ID toggle and the API key tab
:screenshot:
:width: 50%
:::

::::{note}
The Cloud ID is a connection method specifically supported by Beats and {{ls}}. For all other client applications and third-party tools, use the {{es}} endpoint URL.
::::
:::{tip}

1. Go to the {{ecloud}} home page.
2. In the main menu, select **Manage this deployment**.
* When the space uses the **{{es}}** solution view, the **Getting started** page shows the endpoint directly.
* {applies_to}`serverless: ga` You can also open **Connection details** from the project selector in the header.

:::{image} /solutions/images/kibana-manage-deployment.png
:alt: manage deployment
:screenshot:
:::
:::

3. The Cloud ID is displayed on the right side of the page.
::::

:::{image} /solutions/images/kibana-cloud-id.png
:alt: cloud id
:screenshot:
:::
::::{applies-item} {"deployment": {"self": "ga"}}
Your endpoint takes the form `<scheme>://<host>:<port>`. Each part comes from your cluster's HTTP settings:

* **Scheme**: `https` when TLS is enabled on the HTTP layer, and `http` when it isn't. [Automatic security setup](/deploy-manage/security/self-auto-setup.md) enables TLS on a new archive or package installation.
* **Host**: The address clients use to reach the node, set by [`http.host` or `network.host`](elasticsearch://reference/elasticsearch/configuration-reference/networking-settings.md).
* **Port**: The HTTP port, set by [`http.port`](elasticsearch://reference/elasticsearch/configuration-reference/networking-settings.md). It defaults to the range `9200-9300`, and a node binds to the first free port in that range.

For example, a single-node cluster from the [local development quickstart](/deploy-manage/deploy/self-managed/local-development-installation-quickstart.md) runs without TLS on the default port, so its endpoint is `http://localhost:9200`.

### Create an API key [create-an-api-key-cloud-self-managed]
If clients reach your cluster through a load balancer, reverse proxy, or ingress, use that address rather than the node address.
::::

1. To navigate to **API keys**, use the [**global search bar**](../../explore-analyze/find-and-organize/find-apps-and-objects.md).
::::{applies-item} {"deployment": {"eck": "ga"}}
The {{eck}} operator creates a `ClusterIP` service named `<cluster-name>-es-http` on port `9200`, with TLS enabled by default.

:::{image} /solutions/images/kibana-api-keys-search-bar.png
:alt: api keys search bar
:screenshot:
:::
From inside the Kubernetes cluster, your endpoint is `https://<cluster-name>-es-http:9200` in the same namespace, or `https://<cluster-name>-es-http.<namespace>.svc:9200` from another namespace. List your services to confirm the name:

2. Select **Create API key**.
```sh
kubectl get svc
```

:::{image} /solutions/images/kibana-click-create-api-key.png
:alt: click create api key
:screenshot:
:::
To reach the cluster from outside, expose the service and use its external address. Refer to [Access the endpoint](/deploy-manage/deploy/cloud-on-k8s/accessing-services.md#k8s-request-elasticsearch-endpoint) for both cases, including how to retrieve the certificate authority (CA) certificate.
::::

3. Enter the API key details, and select **Create API key**.
4. Copy and securely store the API key, because it only appears once.
:::::

### Find your Cloud ID [find-cloud-id-cloud-self-managed]

## Serverless deployments [_serverless_deployments]
```{applies_to}
deployment:
ech: ga
ece: ga
serverless: ga
```

### Find your Elasticsearch endpoint [find-cloud-id-serverless]
{{beats}} and {{ls}} can use a Cloud ID instead of the endpoint URL. All other clients and tools use the endpoint.
Comment thread
charlotte-hoblik marked this conversation as resolved.
Outdated

1. Select the Help icon in the top right corner and then select **Connection Details**.
2. Copy the **Elasticsearch endpoint** from the **Endpoints** tab.
1. Open {{kib}} for your deployment or project.
2. From the **Help menu** {icon}`question`, select **Connection details**.
3. Turn on **Show Cloud ID**, then copy the value.

:::{image} /solutions/images/kibana-serverless-connection-details.png
:alt: serverless connection details
:screenshot:
:::
:::{tip}
:applies_to: {ech: ga}
To skip {{kib}}, select **Manage** in the {{ecloud}} console and copy the **Cloud ID** from the deployment page.
:::

::::{note}
The **Cloud ID** is also available in the **Connection Details** section. Toggle the **Show Cloud ID** option to view it.
## Create an API key [create-an-api-key-cloud-self-managed]

::::
:::::{applies-switch}

::::{applies-item} { "deployment": { "ech": "ga", "ece": "ga" }, "serverless": "ga" }

### Create an API key [create-an-api-key-serverless]
1. Open {{kib}} for your deployment or project.
2. From the **Help menu** {icon}`question`, select **Connection details**.
3. Select the **API key** tab.
4. In the **API key name** field, enter a name, then select **Create API key**.
5. Select an **API key format**: **Encoded** for {{es}} REST API requests, or **Beats** or **Logstash** to configure those products.
6. Copy the key. It isn't available after you close the panel.

1. Go to the serverless project’s home page.
Keys created here expire in 90 days and carry your own privileges. To set an expiration or restrict privileges, select **Manage API keys** and create the key there instead.
::::

::::{applies-item} {"deployment": {"eck": "ga", "self": "ga"}}
1. Go to the **API keys** management page, using the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md) to find it.
2. Select **Create API key**.
3. Enter a name, then select **Create API key**.
4. Copy the key. It isn't available after you leave the page.

:::{image} /solutions/images/kibana-serverless-create-an-api-key.png
:alt: serverless create an api key
:screenshot:
:::
Keys created here don't expire unless you add an expiration date.
::::

4. Enter the API key details, and select **Create API key**.
5. Copy and securely store the API key, because it only appears once.
:::::

### Test connection [elasticsearch-get-started-test-connection]
For key types, privileges, and expiration options, refer to [](/deploy-manage/api-keys.md).

Use [`curl`](https://curl.se) to verify your connection to {{es}}.
## Test your connection [elasticsearch-get-started-test-connection]

In a terminal, assign the {{es}} endpoint and `encoded` API key to the `ES_URL` and `API_KEY` environment variables respectively. `curl` needs access to these values.
Verify your endpoint and API key with a request to the {{es}} root endpoint.

For example:
1. In a terminal, assign your endpoint and encoded API key to environment variables:

```bash
export ES_URL="https://dda7de7f1d264286a8fc9741c7741690.es.us-east-1.aws.elastic.cloud:443"
export API_KEY="ZFZRbF9Jb0JDMEoxaVhoR2pSa3Q6dExwdmJSaldRTHFXWEp4TFFlR19Hdw=="
```
```bash
export ES_URL="https://a1b2c3d4e5f6.us-central1.gcp.cloud.es.io:443"
export API_KEY="ZFZRbF9Jb0JDMEoxaVhoR2pSa3Q6dExwdmJSaldRTHFXWEp4TFFlR19Hdw=="
```

Next, run the following command to test your connection:
2. Send the request:

```bash
curl "${ES_URL}" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "Content-Type: application/json"
```
```bash
curl "${ES_URL}" -H "Authorization: ApiKey ${API_KEY}"
```

You should receive a response similar to the following:
A successful response returns your cluster details:

```json
{
"name" : "serverless",
"cluster_name" : "dda7de7f1d264286a8fc9741c7741690",
"name" : "instance-0000000000",
"cluster_name" : "my-deployment",
"cluster_uuid" : "ws0IbTBUQfigmYAVMztkZQ",
"version" : { ... },
"tagline" : "You Know, for Search"
}
```

Now you’re ready to start adding data to your {{es-serverless}} project.
:::{note}
:applies_to: {eck: ga, self: ga}
If your cluster uses a self-signed certificate, pass your CA certificate with `curl --cacert`. Refer to [Automatic security setup](/deploy-manage/security/self-auto-setup.md) for the certificate location.
:::

## Next steps

* [Connect a client library](/reference/elasticsearch-clients/index.md) in your language of choice.
* [Ingest data](/solutions/search/ingest-for-search.md) into your cluster or project.
* [Build search queries](/solutions/search/querying-for-search.md) against your data.

## Related pages

* [Configure Beats and {{ls}} with a Cloud ID](/deploy-manage/deploy/elastic-cloud/find-cloud-id.md)
* [Connect to {{es}} on {{ece}}](/deploy-manage/deploy/cloud-enterprise/connect-elasticsearch.md)
* [Securing HTTP client applications](/deploy-manage/security/httprest-clients-security.md)
Binary file removed solutions/images/kibana-api-keys-search-bar.png
Binary file not shown.
Binary file removed solutions/images/kibana-click-create-api-key.png
Binary file not shown.
Binary file removed solutions/images/kibana-cloud-id.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed solutions/images/kibana-manage-deployment.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading