---
title: "Logs in S3"
sidebar_label: "Logs"
description: "How to create a log export and download it"
sidebar_position: 5
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import {CustomTable} from '@selectel/docux/components'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'

# Logs in S3

The [logs](#fields) contain information about requests to buckets.

You can [export logs](#unload-logs) via the Control panel. You can also work with logs via the [Object Storage API](/api/object-storage/).

Exported logs are saved to the selected bucket. Log storage is billed the same way as storing other objects in the storage; for more information, see the [S3 billing model and prices](/s3/about/payment.mdx#storage-volume) guide.

## Log fields \{#fields}

<CustomTable>
  <table data-sticky>
    <tbody>
      <tr>
        <th>client\_ip</th><td>IP address from which the request originated</td>
      </tr>

      <tr>
        <th>client\_to\_server\_bytes</th><td>Number of bytes transferred during the request to storage</td>
      </tr>

      <tr>
        <th>bucket\_name</th><td>Name of the bucket the request was made to</td>
      </tr>

      <tr>
        <th>host</th><td>Host header — address to which the request was made</td>
      </tr>

      <tr>
        <th>http\_method</th><td>HTTP method of the request to storage</td>
      </tr>

      <tr>
        <th>path</th><td>Path to the bucket or object in storage that the request was made to</td>
      </tr>

      <tr>
        <th>query</th><td>Request parameters</td>
      </tr>

      <tr>
        <th>server\_to\_client\_bytes</th><td>Number of bytes transferred in response to the request</td>
      </tr>

      <tr>
        <th>status</th><td>HTTP status code in response to the request</td>
      </tr>

      <tr>
        <th>timestamp</th><td>Date and time of the log entry</td>
      </tr>
    </tbody>
  </table>
</CustomTable>

## Export logs \{#unload-logs}

1. [Create a log export](#create-unloading).
2. [Download a log export](#download-unloading).

### 1. Create a log export \{#create-unloading}

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Logs** section.
3. Select a [region and pool](/infrastructure/locations.mdx).
4. Click **Create export**.
5. Specify the period for which you want to export logs.
6. Optional: select the [fields](#fields) to be displayed in the logs. If you do not select any, all fields will be displayed in the export.
7. Optional: select the buckets whose logs will be included in the export. If you do not select any buckets, the export will include logs for all buckets.
8. Optional: specify the log retention period or leave them to be stored indefinitely. Upon expiration of the retention period, the log file will be deleted from the bucket.
9. Select a bucket where the log file will be saved. If there are no buckets in the storage, click **Create bucket** and [create a new bucket](/s3/buckets/create-bucket.mdx).
10. Click **Create export**. The export will appear on the **Log Export Log** page with the `IN PROGRESS` status. When the export status changes to `DONE`, you will be able to [download it](#download-unloading).

### 2. Download a log export \{#download-unloading}

You can download an export of logs that has not yet expired.

:::info

If the period has expired, the export will still be displayed on the **Log Export Log** page, but the log file will be deleted and download will be unavailable. You can [recreate the export](#recreate-unloading) with the same parameters.

:::

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Logs** section.
3. In the  export menu, select **Download export**.<MoreVerticalIcon />

## Re-create a log export \{#recreate-unloading}

If the log file storage period has expired or an error occurred during export creation, you can repeat the export with the same parameters.

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Logs** section.
3. In the  export menu, select **Recreate export**. The new export will be added as a separate line on the **Log Export History** page with the `IN PROGRESS` status. Once the export changes to the `DONE` status, you will be able to [download it](#download-unloading).<MoreVerticalIcon />

<Formbricks />
