# Integrate Tines with ELK

_**`Task: Using Tines, you need to make an HTTP request to retrieve the size of a specific index. Once the size is obtained, send an email containing this information. After successfully notifying via email, send another HTTP request to clear the index content while ensuring that the index itself remains intact.`**_

Let's begin by sending an HTTP request to Elasticsearch to retrieve a list of all available indices. Once we have the list, we can select any index to work with.

First, we need to configure Ngrok to establish a secure connection between Tines and the Elasticsearch.

```bash
ngrok http https://192.168.204.146:9200/
```

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FeAPvcu6R2j307ezp0keK%2FScreenshot(4).png?alt=media&#x26;token=94e8f24e-d719-4051-bc8c-38507561d501" alt=""><figcaption></figcaption></figure>

Next, we will send an HTTP request to retrieve a list of all available indices.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FhF1TaayhLjpRfnDsiMQG%2FScreenshot(10).png?alt=media&#x26;token=98b603dd-fc2b-4d6a-bc24-eb559246ef4a" alt=""><figcaption></figcaption></figure>

We need to include two headers: one for authorization and another for content type.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FNp1hDWFTecQtLfE1prEi%2FScreenshot(9).png?alt=media&#x26;token=7b604cf0-f6b4-40b0-92e7-0804de9df1b9" alt=""><figcaption></figcaption></figure>

Please ensure that your credentials are encoded in Base64 format. Convert your username and password using the following format: `user:password`, then encode it in Base64.

Now, let's submit the request and review the response.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2F62zSsndRX1qfo88BSn7v%2FScreenshot(11).png?alt=media&#x26;token=4e162cab-3ae3-41b6-b97d-0b59b41a4798" alt=""><figcaption></figcaption></figure>

Each of them is an individual index, and we can choose any one to work with.

Next, we will send an HTTP request to retrieve the size of an index.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FObIPzX4wYF6DCI5Maqbg%2FScreenshot(12).png?alt=media&#x26;token=2a6c3c3f-6507-4bc2-a89f-b3bb633048a3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FCeECf2L59qa65OlYFEL4%2FScreenshot(13).png?alt=media&#x26;token=4ad0c68a-ab20-4c1c-beed-7070586e15aa" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FOm7Ig8vEbydjOBJaLjQO%2FScreenshot(14).png?alt=media&#x26;token=b5096fd6-00ff-4bce-a188-739ccff57651" alt=""><figcaption></figcaption></figure>

Now, we will send the size of the **winlogbeat-2025.02.07** index to our email account.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FuPg6EdAr5mbv8y7Im8Bb%2FScreenshot(19).png?alt=media&#x26;token=f81fafe5-1fd9-444a-bf68-a92ee2f55e50" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FCH2rDfW21u1htuMtfYD5%2FScreenshot(15).png?alt=media&#x26;token=8c6d342f-f0c7-40dc-ae14-a73406714687" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FrYBMLhYYEfn3xNLVhLh1%2FScreenshot(18).png?alt=media&#x26;token=db88302c-1118-4513-8036-95d6ff784cae" alt=""><figcaption></figcaption></figure>

Now, let's proceed with sending another HTTP request to remove the data from this index while preserving the index itself.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FjSf4v0HhSiRgGf5p9877%2FScreenshot(20).png?alt=media&#x26;token=fe50e35d-4167-43c0-89d6-69bd34c6a10b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2F0q61sR5rtPRXeqYTHKdm%2FScreenshot(21).png?alt=media&#x26;token=31412e13-f12f-402d-88a8-bb5142055d92" alt=""><figcaption></figcaption></figure>

Next, we need to send a notification to our email account confirming that the index data has been removed.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FOnsRB89mKOdKoL4aulp0%2FScreenshot(22).png?alt=media&#x26;token=abd12911-4463-4d72-a8bf-b6f389e2eb42" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FGv27HuYAgpugpcTfAXiS%2FScreenshot(23).png?alt=media&#x26;token=4978d061-826a-42a1-8a47-bf97b274bce1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FAc0RpZECUfcWE55CTQ9F%2FScreenshot(24).png?alt=media&#x26;token=ce1addb9-868c-4f15-99cb-dd781cd02e82" alt=""><figcaption></figcaption></figure>
