OSS integrates with Simple Log Service to let you query and analyze access logs directly in the OSS console. Use real-time log query to audit access, track exceptions, and troubleshoot issues.
Prerequisites
-
Real-time log query is enabled for the bucket.
-
Simple Log Service is authorized to access OSS. If not, grant authorization on the Cloud Resource Access Authorization page.
Features
-
Pushes logs to Simple Log Service within 3 minutes for real-time viewing in the OSS console.
-
Provides built-in log analysis and common reports.
-
Queries and analyzes raw logs in real time. Supports filtering by bucket, object name, API operation, or time range.
Billing rules
-
If your Logstore uses the pay-by-feature billing mode, Simple Log Service does not charge for log storage or index traffic if the storage duration of OSS logs is 7 days or less and the daily write traffic (after compression) or index traffic does not exceed 900 GB. For reference, if a single access log is 1 KB, 900 GB is equivalent to approximately 900 million logs. If these limits are exceeded, Simple Log Service charges for the excess log storage and index traffic. For more information, see Billable items of the pay-by-feature mode.
-
Reading, processing, and delivering log data from the dedicated Logstore incurs charges billed through Simple Log Service.
If your Logstore uses the pay-by-feature billing mode, the real-time log query feature provides a monthly free quota of 16 × 31 shard-days. Simple Log Service charges for usage that exceeds this quota. For more information, see Billable items of the pay-by-feature mode.
Procedure
Log on to the OSS console.
In the left-side navigation pane, click Buckets. On the Buckets page, find and click the desired bucket.
-
In the left-side navigation tree, choose .
-
On the Real-time Log Query tab, enter a query statement and an analysis statement based on the query syntax and analysis syntax to analyze log fields.
For example, analyze the
operationfield to countGetObjectoperations on bucketexamplebucketover the past seven days:Sample statement:
* and __topic__: oss_access_log AND bucket:examplebucket AND operation:GetObject | select count(*) AS GetObjectCountSample results:

For more information, see Common examples of real-time OSS log queries.