---
title: "OpenSearch cluster logs"
sidebar_label: "Cluster logs"
sidebar_position: 7
description: "How to enable OpenSearch cluster logging, how to retrieve logs, and how to disable cluster logging"
---

import Formbricks from '@theme/MDXComponents/Formbricks';
import EnableLogs from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/managed-databases/common/enable-logs.mdx';
import DisableLogs from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/managed-databases/common/disable-logs.mdx';
import { CustomTable } from '@selectel/docux/components';

# OpenSearch cluster logs

The [Logs](/logs/) service is used for logging. Read more about how the service works and its pricing in the [Logs service description](/logs/about/about-logs.mdx) article. You can check the availability of the Logs service in locations in the [Log availability by location](/logs/about/logs-availability-by-location.mdx).

To collect cluster logs in the Logs service, you need to [enable logging](#enable-logs). [You can get logs](#get-logs) in the Control panel using API requests or [AWS CLI](/logs/tools/aws-cli.mdx). If you no longer need to collect logs, you can [disable logging](#disable-logs).

Logs are stored for 30 days.

More about logs in OpenSearch databases can be found in the [Logs](https://docs.opensearch.org/latest/install-and-configure/configuring-opensearch/logs) section of the OpenSearch documentation.

## Enable logging \{#enable-logs}

You can enable logging via the API or in the Dashboard:

* when [creating a cluster](/managed-databases/opensearch/create-cluster.mdx);
* or in an [existing cluster](#enable-logs-in-existing-cluster).

### Enable logging in an existing cluster \{#enable-logs-in-existing-cluster}

Logging consumes some of the cluster's computing resources. To control resource consumption, monitor your cluster node metrics.

1. In the [Dashboard](https://my.selectel.ru/vpc/default/dbaas/), on the top menu, click **Products** and select **Managed Databases**.
2. Open the **Active** tab.
3. Open the cluster page → **Settings** tab.
4. In the **Logging** block, in the **Log Service** field, click **Connect**.
5. Select a log group or create a new one.
6. If you selected a new group, enter its name.
7. Click **Save**.

## Get logs \{#get-logs}

Use the [Get logs](/logs/manage/get-logs.mdx) instructions in the Logs section.

For an OpenSearch Managed Database cluster, event streams will be created as `opensearch-<node_role>.log-<instance_id>`, where `<node_role>` is the OpenSearch cluster node role, `<instance_id>` is the OpenSearch cluster node ID.

## Disable logging \{#disable-logs}

<DisableLogs />

<Formbricks />
