# Elasticsearch Integration

## Elasticsearch Configuration Process.

#### Welcome to Pier Cloud!

This document aims to be a guide so that you can prepare the environment to connect the Pier Cloud platform with Elasticsearch using an API connection.

### In the Elasticsearch environment

As a premise, you need to create an API Key in Elasticsearch.

Below, you will find a detailed step-by-step guide on how to configure this.

#### To start the configuration, log in to the elastic cloud portal at the link:

<https://cloud.elastic.co/login>.

* Enter the registered email and password provided by your organization.  \
  Note: To perform this procedure, you must be an “Organization owner”.

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUcY9sI0bpeJk1_RIfnTh7Lbr-u5uPTlO1u93cRi20gTkhARzM0UVtlo-b6zvD5jGUykzPcxoMFURWH5I3G8rZVWxBT7sMXcPVGiexU67Niv9kogam9ACQJ6rePrOYizPjdvjwhg-fTKmodDkEoEvFq862jAJF8A=s2048?key=LbFC3PdQEeH_FLCGr_0TAG2e" alt=""><figcaption></figcaption></figure>

1. Here click on the user icon in the upper right corner, then select the Organization option, as illustrated in the image below.

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUcleMcKVXvfcm7gVkmXBaLDA7_iJxtKYjYXI7HR1KPwSoMpreJa1F9cMxHtRogB-ROBHUMRZHgMxUMdoW-K4CVNsP3emexW8WiDv8HnAWLc393UfVmgGAeY2WFRXgTSJE8sSXe3u5ZciITGiAdioBm9bIzvwwQ=s2048?key=LbFC3PdQEeH_FLCGr_0TAG2e" alt=""><figcaption></figcaption></figure>

2. Here click on **API keys**, as illustrated in the image below.

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUcBaLmykN0j5mKbDLhTO159ROriDhxajN8KHnXceCAh6Gu6fUHqmClWyUINKV2TTxfwrQmJnthy_BAM3mCR1EmNJJ0yPeGoTvMTtc-2t51cb-lT7DYCz1-Crg0OqwzB4E1TGDH_0dPMMzJUsL8hmHb1AhD-7q2N=s2048?key=LbFC3PdQEeH_FLCGr_0TAG2e" alt=""><figcaption></figcaption></figure>

3. In this step click on **Create API key**.

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUerOO9kyBx_GlbWLB3COiGfoFhrSITpdUQFNVjklp1Sm2cuvglNwEylUMUqVWbx-InHYZbNXiNqo0hq3ZUTqqYx3ci8V-05lTjDMU3hIu3-Ik8c9aJEp54MB9P0f8lQg4JiPBZsvIQcnzZHVxmEUIQ67Uwh2mU=s2048?key=LbFC3PdQEeH_FLCGr_0TAG2e" alt=""><figcaption></figcaption></figure>

4. In **Step 1**, under **Add name**, add a name to identify the API key. In **Step 2**, under **Set expiration**, select the API expiration period (in this case, we will choose 1 year). In **Step 3**, under **Assign roles**, enable the **Billing Admin** option. Then, click on **Create API key**, as illustrated in the image below.

Note: This procedure must be performed by the **Organization Owner**.

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUdXzg3SDU9M7Z-XCiIv0kQiS5G56e8AQYDBa1GZj4sO4Yt8cPmKlyB_K2mxZOZs2t7YPuTDftq8fUSDWhC2B_XmnrW46r4Scv1UMdtgKYKPLDHRyVqkvhFveJzybwCTjlri1XIQlBkLBwzoE9KbI5j_UjLvrr6P=s2048?key=LbFC3PdQEeH_FLCGr_0TAG2e" alt=""><figcaption></figcaption></figure>

5. Here, copy the generated key and paste it into a notepad or click on **Download API key**, as illustrated in the image below.

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUcVo4D0nzvp35mxfwzi9tFsZR6uQN7Yxf66L0cNgwW59XpMzSUCRuFHkN2wDwpJCtcx-L47VmJ9rU6DAWJmieSO2mBiI4QFfdz7rOaErjDSdq-6NvAhDrvZcuiBeQ9hmFfDWsydhXMl5ERWagQVNYAMJMJwCg0R=s2048?key=LbFC3PdQEeH_FLCGr_0TAG2e" alt=""><figcaption></figcaption></figure>

6. API key created successfully!
   * Note down the **Organization ID**, as illustrated in the image below.
   * With the **Organization ID** and the **key generated** when creating the API key, we can now proceed to the configuration on the Platform.

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUc9B88qHmEXMCUORhOhEwZWhy5GgWXFI2A-HpdbSggQZKrIOoRk5f6PWgQz46g5GtUxGQwkGhXXvYpTn3n3o8wn3iqOJR3UO_-lwhCt4-C66GXdzU3M6Rd1mUppazZS_UZWYHahKJRE9ngrC99_wXB2GxjK2IZs=s2048?key=LbFC3PdQEeH_FLCGr_0TAG2e" alt=""><figcaption></figcaption></figure>

### On the Pier Cloud Platform

1. On the Pier Cloud platform, click on your user icon, then **settings**.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FCHGnCUyHOqrLdvbEFWZr%2Fimage.png?alt=media&#x26;token=7da4de41-e9f5-4322-842b-1e68047488bf" alt=""><figcaption></figcaption></figure>

2. Here click on **Secrets**, as shown in the image below:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FIbULB21rQeL6JJVdLEs6%2Fimage.png?alt=media&#x26;token=9bd92275-5851-466b-9a38-e766ebb44421" alt=""><figcaption></figcaption></figure>

3. In this step, click on **+ Add.**

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fc5xZ3fgdaLTnOHZY5xHE%2Fimage.png?alt=media&#x26;token=be1f1f09-9a8b-4f9e-8e64-64d5a1414454" alt=""><figcaption></figcaption></figure>

4. In the **Name** field, enter a name to identify the Secret, such as "Elastic Cloud API\_Key". In the **Type** field, select the type of Secret to be created; in this case, choose "API Key". In the **API Key** field, enter the API key generated in the step 10.

Finally, click **Save** to complete the Secret creation.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FTIShevYGR4qAu34sNZGF%2Fimage.png?alt=media&#x26;token=731e1c43-68b5-4aa0-a733-df5a6b337cf0" alt=""><figcaption></figcaption></figure>

5. The Secret for Elasticsearch has been successfully created! We can move on to the next step, so click on **Data Connectors** in the menu on the left, and then click on **+ Add**, to create the data connector, as illustrated below.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fua3loMzHJWpVtV3VBdYp%2Fimage.png?alt=media&#x26;token=e45e00a3-1a04-48d3-aca8-0add95ad05b3" alt=""><figcaption></figcaption></figure>

7. In the **Data Connector** field, select the data connector type, which in this case will be "Elastic Cloud". Then, in the **Data Connector Identifier Name** field, enter a name to identify the connector, such as "Elastic Cloud". In the **Select the Secret for this data connector** field, choose the secret created in the previous step, called "Elastic Cloud API\_Key". In the **Organization ID** field, enter the Organization ID obtained in the step 11. Finally, click **Save** to create the data connector, as illustrated in the image below.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FdlIJIdfMHmk5KPz57Yum%2Fimage.png?alt=media&#x26;token=505d01b8-f665-4f93-a7d0-2c502f97d61a" alt=""><figcaption></figcaption></figure>

8. The ElasticSearch Data connectors have been successfully created! As illustrated in the image below.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FJfB5patasRwx4c4KGdwE%2Fimage.png?alt=media&#x26;token=c13baec0-9954-44ae-87a4-faeb44c91955" alt=""><figcaption></figcaption></figure>
