Export logs

更新时间:
复制 MD 格式

You can download logs and query results for local analysis, or ship them to an OSS bucket for long-term storage.

Prerequisites

The log analysis feature of Cloud Firewall must be enabled. For more information, see Overview of log analysis.

Download logs to your computer

You can download logs directly from the console to your computer.

Console download

Important
  • If a download request exceeds the maximum number of logs allowed per download, only the maximum number is downloaded. To download all logs, narrow the time range of your query and perform multiple downloads.

    You can view your download history in the Download Tasks dialog box.

  • Each Alibaba Cloud account supports a maximum of three concurrent download tasks. This limit is shared across all RAM users. Exceeding this limit causes an error. If an error occurs, wait for the existing tasks to complete before you try again.

  • Export records are automatically deleted after 24 hours.

  • The system automatically retries a download task if a network error occurs or if query results are imprecise. If the task still fails after three retries, its status is set to Failed.

  1. Log on to the Cloud Firewall console.

  2. In the left-side navigation pane, choose Detection & Response > Log Analysis. Then, click the Logs tab.

  3. To download the results of a specific query, first set your query conditions and run the query. For more information, see Query and analyze logs.

  4. On the Raw Logs tab, click the image icon and select Download Log.

    Note

    If no logs are available, the Download Log option is disabled.

  5. In the Download Log dialog box, configure the following parameters and click OK.

    Parameter

    Description

    Task Name

    Download task name.

    Log Quantity

    Number of logs to download.

    Data Format

    CSV or JSON.

    • CSV: Column names come from the first 100 log fields. New fields in subsequent logs are stored in JSON format in an unnamed final column.

    • JSON: Each log entry is a single JSON line.

    Quote

    Encloses fields containing special characters to prevent unintended escaping.

    Download Inaccurate Results

    If you select No, the download fails if the query results are inaccurate.

    Compression Method

    gzip, lz4, zstd, or none.

    Compression significantly reduces file size and download time for large datasets.

  6. In the Download Tasks dialog box, wait for the task status to change to Successful, and then click Download.

    You can also open the Download Tasks dialog box by clicking the image icon on the Raw Logs tab and selecting Download Tasks.

Ship logs to OSS

For large log volumes or long-term analysis, you can periodically ship logs to an OSS bucket. For instructions, see Create an OSS data shipping job (new version).

Related documents

For details on all log fields, see Log fields.