Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Public Cloud Databases - How to setup logs forwarding
title: Public Cloud Databases - How to set up logs forwarding
excerpt: Find out how to forward logs of your database service to your Logs Data Platform data stream
updated: 2024-09-25
updated: 2024-10-28
---

## Objective
Expand All @@ -21,42 +21,91 @@ Public Cloud managed databases allow you to send logs of your service to your ow

## Instructions

### Step 1 - Retrieve the required information
### Create your subscription

> [!tabs]
> Via the OVHcloud Control Panel
>> On the database instance page, go to the `Logs`{.action} section and click the `Subscribe`{.action} button.
>>
>> ![LDP database subscription](images/ldp_database_subscription.png){.thumbnail}
>>
>> Select the relevant LDP account by clicking the `Subscribe`{.action} button.
>>
>> ![LDP database subscription 2](images/ldp_database_subscription2.png){.thumbnail}
>>
>> The logs will then start to be forwarded to your LDP stream.
>>
> Via the OVHcloud API
>>
>> 1\. Retrieve the required information
>>
>> **Retrieve your LDP destination `streamId`:**
>>
>> Log in to the [OVHcloud Control Panel](/links/manager), go to the `Identity, Security & Operations`{.action} section. In the left-hand menu, select `Logs Data Platform`{.action} then click on the relevant LDP instance.
>>
>> ![LDP list page](images/ldp_page.png){.thumbnail}
>>
>> Go to the `Data stream`{.action} tab.
>>
>> ![LDP details page](images/ldp_page_details.png){.thumbnail}
>>
>> Choose your target stream and click on `Copy stream ID`{.action}.
>>
>> **Retrieve your LDP destination `serviceName`:**
>>
>> - This refers to your Public Cloud project ID. You can retrieve it in the Public Cloud section of your project.
>>
>> ![LDP project id](images/ldp_project_id.png){.thumbnail}
>>
>> **Retrieve your `clusterId`:**
>>
>> Log in to the [OVHcloud Control Panel](/links/manager), open the `Public Cloud`{.action} section and select the Public Cloud project concerned. In the left-hand menu, click on `Databases`{.action}, then choose the database instance you want to manage.
>>
>> In the cluster details, you can find the `Service ID` field, which corresponds to the cluster ID.
>>
>> ![LDP database details](images/ldp_database_details.png){.thumbnail}
>>
>> 2\. Start by retrieving the types of logs available for your database cluster with the following API call:
>>
>> > [!api]
>> >
>> > @api {v1} /cloud GET /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/kind
>> >
>>
>> This will return the list of valid kind values you can use when subscribing to logs.
>>
>> 3\. Once you know the valid kind, use it to subscribe to a log stream with this API call:
>>
>> > [!api]
>> >
>> > @api {v1} /cloud POST /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/subscription
>> >
>>
>> ```console
>> body : {
>> kind: <log_type_from_previous_call>
>> streamId: <your_stream_id>
>> }
>> ```
>>
>> The logs will then start to be forwarded to your LDP stream.
>>

#### Retrieve your LDP destination `streamId`:

- In the OVHcloud Control Panel, go to your LDP page.
- Go to the `Data stream` tab.
- Choose your target stream and click on `Copy stream ID`{.action}.

#### Retrieve your LDP destination `serviceName`:

- It refers to your Public Cloud project ID.

#### Retrieve your `clusterId`:
### Find logs in Graylog

- In the OVHcloud Control Panel, go to your database.
- You can see the field `Cluster ID`.
On the LDP page, click the `sample-data-stream`{.action} button (the last data stream modified when you previously subscribed to it), or click the `Graylog`{.action} button.

### Step 2 - Create your subscription
![LDP database go to graylog](images/ldp_database_go_to_graylogs.png){.thumbnail}

Use the following API call:
You need to log in using your Graylog credentials. You can retrieve them from the LDP details page, in the `Configuration` section. The login corresponds to the value shown on the `Logs Data Platform service` line, and the password is displayed under `Password`.

> [!api]
>
> @api {v1} /cloud POST /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/subscription
>
![LDP database ldp details](images/ldp_database_ldp_details.png){.thumbnail}

```console
body : {
streamId: <LDP destination stream ID>
}
```
Then logs will start to be forwarded to your LDP stream.
Once connected, you can view your service logs in your Graylog stream.

### Find logs in Graylog
![LDP database graylogs result](images/ldp_database_graylogs_result.png){.thumbnail}

To find logs of your service in your graylogs stream you can use the following graylog queries:
You can also use the following Graylog queries for more granular filtering:

#### MongoDB

Expand All @@ -80,12 +129,21 @@ You can find this `HostID` in your OVHcloud Control Panel:

You have 2 methods to delete a subscription:

- You can delete subscriptions using the `subscriptionId` concerned in this API call:

> [!api]
>
> @api {v1} /cloud DELETE /cloud/project/{serviceName}/database/mongodb/{clusterId}/log/subscription/{subscriptionId}
>
> [!tabs]
> Via the OVHcloud Control Panel
>> In the subscription page of the database instance, click the `Unsubscribe`{.action} button.
>>
>> ![LDP database unsubscribe](images/ldp_database_unsubscribe.png){.thumbnail}
>>
> Via the OVHcloud API
>>
>> - You can delete subscriptions using the `subscriptionId` concerned in this API call:
>>
>> > [!api]
>> >
>> > @api {v1} /cloud DELETE /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/subscription/{subscriptionId}
>> >
>>

- If you delete your database service, all subscriptions of this service are deleted automatically.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Public Cloud Databases - How to setup logs forwarding
title: Public Cloud Databases - How to set up logs forwarding
excerpt: Find out how to forward logs of your database service to your Logs Data Platform data stream
updated: 2024-09-25
updated: 2024-10-28
---

## Objective
Expand All @@ -21,42 +21,91 @@ Public Cloud managed databases allow you to send logs of your service to your ow

## Instructions

### Step 1 - Retrieve the required information
### Create your subscription

> [!tabs]
> Via the OVHcloud Control Panel
>> On the database instance page, go to the `Logs`{.action} section and click the `Subscribe`{.action} button.
>>
>> ![LDP database subscription](images/ldp_database_subscription.png){.thumbnail}
>>
>> Select the relevant LDP account by clicking the `Subscribe`{.action} button.
>>
>> ![LDP database subscription 2](images/ldp_database_subscription2.png){.thumbnail}
>>
>> The logs will then start to be forwarded to your LDP stream.
>>
> Via the OVHcloud API
>>
>> 1\. Retrieve the required information
>>
>> **Retrieve your LDP destination `streamId`:**
>>
>> Log in to the [OVHcloud Control Panel](/links/manager), go to the `Identity, Security & Operations`{.action} section. In the left-hand menu, select `Logs Data Platform`{.action} then click on the relevant LDP instance.
>>
>> ![LDP list page](images/ldp_page.png){.thumbnail}
>>
>> Go to the `Data stream`{.action} tab.
>>
>> ![LDP details page](images/ldp_page_details.png){.thumbnail}
>>
>> Choose your target stream and click on `Copy stream ID`{.action}.
>>
>> **Retrieve your LDP destination `serviceName`:**
>>
>> - This refers to your Public Cloud project ID. You can retrieve it in the Public Cloud section of your project.
>>
>> ![LDP project id](images/ldp_project_id.png){.thumbnail}
>>
>> **Retrieve your `clusterId`:**
>>
>> Log in to the [OVHcloud Control Panel](/links/manager), open the `Public Cloud`{.action} section and select the Public Cloud project concerned. In the left-hand menu, click on `Databases`{.action}, then choose the database instance you want to manage.
>>
>> In the cluster details, you can find the `Service ID` field, which corresponds to the cluster ID.
>>
>> ![LDP database details](images/ldp_database_details.png){.thumbnail}
>>
>> 2\. Start by retrieving the types of logs available for your database cluster with the following API call:
>>
>> > [!api]
>> >
>> > @api {v1} /cloud GET /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/kind
>> >
>>
>> This will return the list of valid kind values you can use when subscribing to logs.
>>
>> 3\. Once you know the valid kind, use it to subscribe to a log stream with this API call:
>>
>> > [!api]
>> >
>> > @api {v1} /cloud POST /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/subscription
>> >
>>
>> ```console
>> body : {
>> kind: <log_type_from_previous_call>
>> streamId: <your_stream_id>
>> }
>> ```
>>
>> The logs will then start to be forwarded to your LDP stream.
>>

#### Retrieve your LDP destination `streamId`:

- In the OVHcloud Control Panel, go to your LDP page.
- Go to the `Data stream` tab.
- Choose your target stream and click on `Copy stream ID`{.action}.

#### Retrieve your LDP destination `serviceName`:

- It refers to your Public Cloud project ID.

#### Retrieve your `clusterId`:
### Find logs in Graylog

- In the OVHcloud Control Panel, go to your database.
- You can see the field `Cluster ID`.
On the LDP page, click the `sample-data-stream`{.action} button (the last data stream modified when you previously subscribed to it), or click the `Graylog`{.action} button.

### Step 2 - Create your subscription
![LDP database go to graylog](images/ldp_database_go_to_graylogs.png){.thumbnail}

Use the following API call:
You need to log in using your Graylog credentials. You can retrieve them from the LDP details page, in the `Configuration` section. The login corresponds to the value shown on the `Logs Data Platform service` line, and the password is displayed under `Password`.

> [!api]
>
> @api {v1} /cloud POST /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/subscription
>
![LDP database ldp details](images/ldp_database_ldp_details.png){.thumbnail}

```console
body : {
streamId: <LDP destination stream ID>
}
```
Then logs will start to be forwarded to your LDP stream.
Once connected, you can view your service logs in your Graylog stream.

### Find logs in Graylog
![LDP database graylogs result](images/ldp_database_graylogs_result.png){.thumbnail}

To find logs of your service in your graylogs stream you can use the following graylog queries:
You can also use the following Graylog queries for more granular filtering:

#### MongoDB

Expand All @@ -80,12 +129,21 @@ You can find this `HostID` in your OVHcloud Control Panel:

You have 2 methods to delete a subscription:

- You can delete subscriptions using the `subscriptionId` concerned in this API call:

> [!api]
>
> @api {v1} /cloud DELETE /cloud/project/{serviceName}/database/mongodb/{clusterId}/log/subscription/{subscriptionId}
>
> [!tabs]
> Via the OVHcloud Control Panel
>> In the subscription page of the database instance, click the `Unsubscribe`{.action} button.
>>
>> ![LDP database unsubscribe](images/ldp_database_unsubscribe.png){.thumbnail}
>>
> Via the OVHcloud API
>>
>> - You can delete subscriptions using the `subscriptionId` concerned in this API call:
>>
>> > [!api]
>> >
>> > @api {v1} /cloud DELETE /cloud/project/{serviceName}/database/{engine}/{clusterId}/log/subscription/{subscriptionId}
>> >
>>

- If you delete your database service, all subscriptions of this service are deleted automatically.

Expand Down
Loading