Skip to main content

Send logs to Elasticsearch®

You can store logs from one of your Aiven services in an external Elasticsearch service.

Collect these values for the connection:

VariableDescription
ELASTICSEARCH_USERUser name to access the Elasticsearch service.
ELASTICSEARCH_PASSWORDPassword to access the Elasticsearch service.
ELASTICSEARCH_HOSTHTTPS service host of your external Elasticsearch service.
ELASTICSEARCH_PORTPort to use for the connection.
CA_CERTIFICATECA certificate in PEM structure, if necessary.
CONNECTION_NAMEName of this external connection to be used with Aiven services.

Create external Elasticsearch integration

Start by setting up an external service integration for Elasticsearch.

  1. Log in to the Aiven Console.
  2. In the project, click Integration endpoints.
  3. Select External Elasticsearch from the list.
  4. Select Add new endpoint.
  5. Set a preferred endpoint name, we'll call it CONNECTION_NAME later.
  6. In the connection URL field set the connection string in a format https://ELASTICSEARCH_USER:ELASTICSEARCH_PASSWORD@ELASTICSEARCH_HOST:ELASTICSEARCH_PORT, using your own values for those parameters.
  7. Set desired index prefix, that doesn't overlap with any of already existing indexes in your Elasticsearch service.
  8. Optional: Add the body of your CA certificate in PEM format.
  9. Click Create.

Send service logs to Elasticsearch

  1. Click Services and open a a service.
  2. On the sidebar, click Integrations.
  3. Select Elasticsearch Logs from the list.
  4. Select the Endpoint name and click Enable.
note

Logs are split per day with index name consisting of your desired index prefix and a date in a format year-month-day, for example logs-2022-08-30.

note

You can also set up the integration using Aiven CLI and the following commands:

warning

Integration are not available on Hobbyist plans. To enable integrations, select at least a startup plan.