01 Install and configure Simple Log Service (SLS) CLI. SLS CLI is a dedicated command-line tool for Alibaba Cloud's Simple Log Service (SLS).
02 Run list_project command (OSX/Linux/UNIX) to describe the information available for each Simple Log Service (SLS) project deployed in your Alibaba Cloud account:
aliyunlog log list_project --format-output=json
03 The command output should return the requested information (including the project name, i.e. the "projectName" value):
{
"projects": [
{
"createTime": "1709556764",
"dataRedundancyType": "LRS",
"description": "",
"lastModifyTime": "1709556764",
"owner": "",
"projectName": "tm-sls-main-project",
"region": "eu-west-1",
"resourceGroupId": "rg-abcdabcdabcdabc",
"status": "Normal"
},
{
"createTime": "1709222851",
"dataRedundancyType": "LRS",
"description": "",
"lastModifyTime": "1709222851",
"owner": "",
"projectName": "slsaudit-region-1234567890123456-eu-west-1",
"region": "eu-west-1",
"resourceGroupId": "rg-abcdabcdabcdabc",
"status": "Normal"
}
],
"count": 2,
"total": 2
}
04 Run list_logstore command (OSX/Linux/UNIX) using the name of the SLS project that you want to examine as the identifier parameter, to list the name of each Logstore created for the selected project:
aliyunlog log list_logstore
--project_name=tm-sls-main-project
--format-output=json
05 The command output should return the requested information:
{
"logstores": [
"tm-sls-main-project-logstore",
"tm-sls-audit-data-logstore"
],
"count": 2,
"total": 2
}
06 Run get_logstore command (OSX/Linux/UNIX) to describe the configuration information available for the specified Simple Log Service (SLS) Logstore:
aliyunlog log get_logstore
--project_name=tm-sls-main-project
--logstore_name=tm-sls-main-project-logstore
--format-output=json
07 The command output should return the requested configuration information (including the log retention period, i.e. the "ttl" value):
{
"shardCount": 1,
"telemetryType": "",
"ttl": 90,
"appendMeta": true,
"archiveSeconds": 0,
"autoSplit": true,
"createTime": 1709556812,
"enable_tracking": false,
"hot_ttl": 90,
"infrequentAccessTTL": 0,
"lastModifyTime": 1709568873,
"logstoreName": "tm-sls-main-project-logstore",
"maxSplitShard": 64,
"mode": "standard",
"productType": "",
"resourceQuota": {
"storage": {
"preserved": -1,
"used": 0
}
}
}
Check the
"ttl" attribute value to determine the number of days to retain activity logs for the selected Logstore. If the
"ttl" value is less than 365 days and different from 3650 (i.e. retain data permanently), the selected Simple Log Service (SLS) Logstore does not have a sufficient log retention period configured.
08 Repeat steps no. 6 and 7 for each SLS Logstore created for the selected project.
09 Repeat steps no. 4 - 8 for each SLS project available within your Alibaba Cloud account.