Skip to main content

Log archiving settings

Log archiving uploads original logs whose retention period is about to end to your object storage every hour. This keeps the original logs you need for audits or failure analysis in your bucket even after the WhaTap log retention period has passed.

Home > Select Project > Log > Log setting > Log archiving tab

Log archiving is available only in on-premises environments. In SaaS environments, the Log setting screen does not show the Log archiving tab.

Supported storage and authentication methods​

StorageAuthDescription
AWS S3Access KeyEnter the Access Key and Secret Key of an IAM user that can write to the bucket
AWS S3Role ARNEnter the ARN of an IAM role created in your AWS account. The WhaTap collection server obtains temporary credentials for this role at each upload, so no access key is stored
AWS S3Server CredentialsUses the AWS credentials configured on the WhaTap collection server. Available only when the collection server option logsink_archiving_server_credentials_enabled is true
NCP Object StorageAccess KeyEnter the Access Key and Secret Key of NCP Object Storage

Server Credentials uploads using the server's own credentials, such as environment variables on the collection server, the ~/.aws configuration, or the IAM role of EC2 or EKS. If the collection server option logsink_archiving_server_credentials_enabled is false, the Configuration step of the connection test fails with SERVER_CREDENTIALS_DISABLED.

Prerequisites​

To use log archiving, first enable archiving in yard.conf of the collection server (yard). The default values of logsink_archiving_enabled and logsink_archiving_server_credentials_enabled are both false.

OptionDescription
logsink_archiving_enabledIf true, the collection server runs archiving jobs. In a distributed setup with multiple collection servers, set it to true on only one server
logsink_archiving_server_credentials_enabledIf true, allows the Server Credentials authentication method
logsink_archiving_enabled=true
logsink_archiving_server_credentials_enabled=true

If logsink_archiving_enabled is false, archiving does not run even if you save the settings and pass the connection test. The screen shows no message about this state. If no records appear in Archiving history after you save the settings, check the logsink_archiving_enabled option.

Adding archiving​

  1. On the Log archiving tab, click the Add archiving button.

  2. In the Default settings area, set the following items.

    ItemDescription
    StorageSelect AWS S3 or NCP Object Storage
    Authentication methodFor AWS S3, select Access Key, Role ARN, or Server Credentials. For NCP Object Storage, this item is not shown and Access Key is used
    BucketName of the bucket to upload to
    RegionRequired for the Access Key and Role ARN methods of AWS S3. Example: ap-northeast-2
    CategoryLog categories to archive. Select one or more
  3. In the Credentials area, enter the values for the authentication method. For the Access Key method, enter Access Key and Secret Key. The Server Credentials method requires no values. For the Role ARN method, see Creating a Role ARN role.

  4. If needed, click Additional settings to expand the area and set the items. The area is collapsed at first, and default values apply to any item you do not set.

    ItemDescription
    EndpointRequired for NCP Object Storage, with the default https://kr.object.ncloudstorage.com. Optional for AWS S3
    RegionShown in this area for NCP Object Storage and the AWS S3 Server Credentials method. The default for NCP Object Storage is kr-standard. Optional for the Server Credentials method
    External IDShown for the Role ARN method. Read-only; copy the value with the copy button
    Path prefixLeading part of the path where files are stored in the bucket. Optional
    File formatSelect JSONL_GZIP, PARQUET_SNAPPY, or PARQUET_ZSTD. The default is JSONL_GZIP
    Category filterArchives only the logs that match the condition for each category. Categories without a filter archive all logs. Shown only when at least one Category is selected
    Number of days before storage expirationHow many days before the end of the retention period archiving starts. An integer of 1 or greater; the default is 2
    NotificationSelecting Notify when action is required sends a notification when archiving fails and action is required. Select Receive all or Receive selected tags
  5. Click the Connection test button in the Verification item. You must pass the connection test to save the settings.

  6. Click the Add button. When editing existing settings, click the Apply button.

Number of days before storage expiration must be less than the log retention period. For example, if the retention period is 7 days and the value is 2, logs that are 5 to 7 days old are archived in sequence.

Connection test​

When you click the Connection test button, the configuration, bucket access, write, read, and bucket region are checked in order, and the result of each step is shown. Read and bucket region are optional. If any of the required steps (configuration, bucket access, write) fails, the remaining steps are skipped. Check the message of the failed step and correct the permissions or input values.

Even when the connection test passes, a message is shown that transfer costs may apply if the bucket region differs from the collection server region, or if data is sent to another cloud or over the public network. If the location of the collection server cannot be determined, the message is not shown.

When editing existing settings, re-enter the credentials for the connection test.

Creating a Role ARN role​

With the Role ARN method, you create an IAM role that can write to the bucket in your AWS account, and the WhaTap collection server uploads with the temporary credentials of that role.

  1. Select Role ARN in Authentication method. The screen shows the Trust Policy and Permissions Policy.

  2. In the AWS console, create an IAM role, and paste the Trust Policy on the screen as the trust policy and the Permissions Policy as the permissions policy. Click the copy button to the right of each policy to copy its content.

  3. Enter the ARN of the created role in the Role ARN field. Example: arn:aws:iam::123456789012:role/whatap-log-archiving

The Trust Policy contains the AWS identity of the WhaTap collection server and the project-specific External ID. When you write the trust policy yourself with a tool such as Terraform, put the External ID value from Additional settings in the sts:ExternalId condition. The Permissions Policy includes only the minimum permissions required for the connection test and uploads.

If the collection server has no AWS credentials, the server's AWS identity cannot be determined, so the Trust Policy is not generated and an error message is shown. In this case, contact your server administrator.

Settings summary and execution history​

After you save the settings, the Log archiving tab shows the settings summary and Archiving history.

  • Settings summary: Shows the active state, storage, authentication, bucket, file format, path, categories, and notification settings. Use the active switch to enable or disable archiving immediately.
  • Archiving history: Shows the execution result for each hour with the start time, target time, category, status, number of rows, raw size, size, and errors. Use the category and status filters to view only the results you need.
StatusDescription
SUCCESSUpload succeeded
FAILEDUpload failed. Can be retried
FAILED_PERMANENTFailure that requires action. Resolve the cause, then retry
SKIPPEDSkipped because there are no logs in the target hour, no logs match the category filter, or the retention period condition is not met. Hover over the tag to see the reason

You can run FAILED and FAILED_PERMANENT records again with the Retry button. You cannot retry an hour whose retention period has passed, an hour that is already running or already archived, or when archiving is inactive.

If the settings are saved but cannot be delivered to the collection server, the screen shows a message that redeployment is required. Click the Retry button in the message to deploy the settings again.