Queries column store audit logs.
Operation description
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardbx:QueryColumnarLog |
get |
*All Resource
|
None | None |
Request syntax
POST / HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the request. The value must match the region where the SQLQuery service is deployed. |
cn-hangzhou |
| DBInstanceName |
string |
Yes |
The ID of the PolarDB-X instance for which you want to query column store audit logs. |
pxc-******** |
| SQL |
string |
Yes |
The read-only query statement to execute. Only a single MySQL SELECT statement is supported. Query tables must use the fully qualified form polardbx_sls.<table_name>, and only the following tables are allowed: polardbx_sls.polardbx_log (kernel logs), polardbx_sls.slow_detail_log (slow query logs), polardbx_sls.slow_trans_log (slow transaction logs), and polardbx_sls.sql_audit_log (audit logs). Multi-statement queries, write operations, locks, user variables, dynamic placeholders, and reserved hints are not supported. |
SELECT * FROM polardbx_sls.sql_audit_log LIMIT 100 |
| MaxResultRows |
integer |
No |
The maximum number of result rows to return for this request. Valid values: 1 to 1000. Default value: 100. The actual number of returned rows is also subject to the top-level LIMIT clause in the SQL statement and the current service policy. |
1000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. This ID is used throughout the entire process from access, authentication, and routing to query completion, which facilitates end-to-end troubleshooting. |
9B2F3840-****-475C-B269-2D5C3A31797C |
| QueryId |
string |
The unique identifier generated by the service for this JDBC query. |
{\"NodeId\":\"n_7844571364614995969\"} |
| AccessDeniedDetail |
object |
The details about the access denial. |
|
| AuthAction |
string |
The authentication action. |
polardbx:QueryColumnarLog |
| AuthPrincipalType |
string |
The type of the authentication principal. |
222 |
| AuthPrincipalOwnerId |
string |
The owner ID of the authentication principal. |
111 |
| AuthPrincipalDisplayName |
string |
The display name of the authentication principal. |
Sample RAM user |
| PolicyType |
string |
The policy type. |
PRIORITY |
| NoPermissionType |
string |
The type of the missing permission. |
ImplicitDeny |
| EncodedDiagnosticMessage |
string |
The diagnostic information. |
AQEAAAAAaKPfwjY0MzMyODRGLUZCQkQtNTA1RS04MUUxLTc5NTkzODk2MUIzMg== |
| Records |
array<object> |
The list of query results. Each row is a JSON key-value object that maps column names to text values. All scalars are returned as strings. SQL NULL is encoded as the string null, and empty strings remain as empty strings. |
|
|
object |
The list of download records. |
||
|
string |
A single column value in the query result. All scalars are returned as strings. SQL NULL is encoded as the string null. An empty string remains an empty string. |
null |
|
| AppliedOffset |
integer |
The top-level SQL LIMIT offset that the service actually applied. The value is 0 if the SQL statement does not specify an offset. |
0 |
| AppliedRowLimit |
integer |
The maximum number of rows that the service actually returns after evaluating the top-level SQL LIMIT clause, MaxResultRows, the default value of the synchronous API, and the current service policy. This value does not include the extra row used to detect HasMore. |
1000 |
| ReturnedRowCount |
integer |
The actual number of result rows returned in this synchronous response. |
100 |
| HasMore |
boolean |
Indicates whether the service or API row limit truncated the SQL statement submitted by the caller. The value is false when the SQL statement with a smaller LIMIT clause is fully executed, which does not indicate that no more data exists in the underlying table. |
False |
| RecordsSizeBytes |
integer |
The total number of UTF-8 bytes of the JSON objects across all returned rows, excluding the array and fixed response fields. The complete JSON response of the synchronous API is also subject to a 16 MiB upper limit. |
8192 |
| QueryElapsedTimeMilliseconds |
integer |
The elapsed time from the start of the JDBC statement execution to the completion of reading the last result row or probe row. Unit: milliseconds. |
125 |
Examples
Success response
JSON format
{
"RequestId": "9B2F3840-****-475C-B269-2D5C3A31797C",
"QueryId": "{\\\"NodeId\\\":\\\"n_7844571364614995969\\\"}",
"AccessDeniedDetail": {
"AuthAction": "xxx",
"AuthPrincipalType": "222",
"AuthPrincipalOwnerId": "111",
"AuthPrincipalDisplayName": "xxx",
"PolicyType": "PRIORITY",
"NoPermissionType": "ImplicitDeny",
"EncodedDiagnosticMessage": "AQEAAAAAaKPfwjY0MzMyODRGLUZCQkQtNTA1RS04MUUxLTc5NTkzODk2MUIzMg=="
},
"Records": [
{
"key": "null"
}
],
"AppliedOffset": 0,
"AppliedRowLimit": 1000,
"ReturnedRowCount": 100,
"HasMore": true,
"RecordsSizeBytes": 8192,
"QueryElapsedTimeMilliseconds": 125
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.