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
| Storage | Auth | Description |
|---|---|---|
| AWS S3 | Access Key | Enter the Access Key and Secret Key of an IAM user that can write to the bucket |
| AWS S3 | Role ARN | Enter 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 S3 | Server Credentials | Uses 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 Storage | Access Key | Enter 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.
| Option | Description |
|---|---|
logsink_archiving_enabled | If 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_enabled | If 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
-
On the Log archiving tab, click the Add archiving button.
-
In the Default settings area, set the following items.
Item Description Storage Select AWS S3 or NCP Object Storage Authentication method For AWS S3, select Access Key,Role ARN, orServer Credentials. For NCP Object Storage, this item is not shown andAccess Keyis usedBucket Name of the bucket to upload to Region Required for the Access KeyandRole ARNmethods of AWS S3. Example:ap-northeast-2Category Log categories to archive. Select one or more -
In the Credentials area, enter the values for the authentication method. For the
Access Keymethod, enter Access Key and Secret Key. TheServer Credentialsmethod requires no values. For theRole ARNmethod, see Creating a Role ARN role. -
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.
Item Description Endpoint Required for NCP Object Storage, with the default https://kr.object.ncloudstorage.com. Optional for AWS S3Region Shown in this area for NCP Object Storage and the AWS S3 Server Credentialsmethod. The default for NCP Object Storage iskr-standard. Optional for theServer CredentialsmethodExternal ID Shown for the Role ARNmethod. Read-only; copy the value with the copy buttonPath prefix Leading part of the path where files are stored in the bucket. Optional File format Select JSONL_GZIP,PARQUET_SNAPPY, orPARQUET_ZSTD. The default isJSONL_GZIPCategory filter Archives 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 expiration How many days before the end of the retention period archiving starts. An integer of 1 or greater; the default is 2Notification Selecting Notify when action is required sends a notification when archiving fails and action is required. Select Receive all or Receive selected tags -
Click the Connection test button in the Verification item. You must pass the connection test to save the settings.
-
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.
-
Select
Role ARNin Authentication method. The screen shows the Trust Policy and Permissions Policy. -
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.
-
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.
| Status | Description |
|---|---|
SUCCESS | Upload succeeded |
FAILED | Upload failed. Can be retried |
FAILED_PERMANENT | Failure that requires action. Resolve the cause, then retry |
SKIPPED | Skipped 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.