閱讀959 返回首頁    go 小米淨水器


查詢SQL審計日誌__日誌管理_API 參考_雲數據庫 RDS 版-阿裏雲

描述

說明:查詢實例的SQL審計日誌。

請求參數

名稱 類型 是否必須 描述
Action String 係統規定參數,取值:DescribeSQLLogRecords
DBInstanceId String 實例名
Database String 默認為所有
User String 默認為所有
Form String File,觸發審計日誌文件的生成,若傳入這個值,則隻返回公共參數,需再調用DescribeSQLLogFiles接口獲取文件的最終下載地址;Stream,返回數據流。默認為Stream
QueryKeywords String 關鍵字查詢,多個關鍵字以空格分隔,不超過10個關鍵字。
StartTime String 查詢開始時間,格式如:yyyy-MM-dd’T’HH:mm:ssZ
EndTime String 查詢結束時間,格式如:yyyy-MM-dd’T’HH:mm:ssZ,且大於查詢開始時間
PageSize Integer 每頁記錄數,取值:30/50/100/200;默認值:100
PageNumber Integer 頁碼,大於0,且不超過Integer的最大值;默認值:1

返回參數

名稱 類型 描述
<公共返回參數> 詳見附錄
TotalRecordCount Integer 總記錄數
PageNumber Integer 頁碼
PageRecordCount Integer 本頁SQL日誌明細個數
Items List<SQLRecord>

SQLRecord參數

名稱 類型 描述
DBName String 數據庫
AccountName String 賬號名
HostAddress String 客戶端IP地址
SQLText String SQL語句
TotalExecutionTimes Long 消耗時間,單位:微秒
ReturnRowCounts Long 返回記錄數
ThreadID String 線程ID
ExecuteTime String 執行時間;格式:yyyy-MM-dd’T’HH:mm:ssZ,如2011-05-30 T12:11:20Z

示例

  • 請求示例
  1. https://rds.aliyuncs.com/?Action=DescribeSQLLogRecords
  2. &DBInstanceId=riauvjz6zajfiq6ba1370329449201
  3. &StartTime=2011-06-11T15:00:00Z
  4. &EndTime=2013-06-05T15:00:00Z
  5. &<公共請求參數>
  • 返回示例

XML格式:

  1. <DescribeSQLLogRecordsResponse>
  2. <RequestId>08A3B71B-FE08-4B03-974F-CC7EA6DB1828</RequestId>
  3. <TotalRecordCount>1</TotalRecordCount>
  4. <PageNumber>1</PageNumber>
  5. <PageRecordCount >1<PageRecordCount>
  6. <Items>
  7. <SQLRecord>
  8. <DBName>test</DBName>
  9. <AccountName>accounttest</AccountName>
  10. <HostAddress>192.168.0.121</HostAddress>
  11. <SQLText>update test.zxb set id=0 limit 1</SQLText>
  12. <TotalExecutionTimes >12</TotalExecutionTimes>
  13. <ReturnRowCounts>34</ReturnRowCounts>
  14. <ExecuteTime>2011-06-11T15:00:23Z</ExecuteTime>
  15. </SQLRecord>
  16. </Items>
  17. </DescribeSQLLogRecordsResponse>

JSON格式:

  1. {
  2. "PageNumber":1,
  3. "TotalRecordCounts":1,
  4. "ItemsCounts":1
  5. "SQLItems":
  6. {"SQLItem":
  7. [
  8. {
  9. "DBName":”test”
  10. "AccountName":”accounttest”
  11. "HostAddress":” 192.168.0.121”
  12. "SQLText":”update test.zxb set id=0 limit 1”
  13. "TotalExecutionTimes":12
  14. "ReturnRowCounts":34
  15. "ExecuteTime":”2011-06-11T15:00:23Z”
  16. }
  17. ]
  18. },
  19. "RequestId": "08A3B71B-FE08-4B03-974F-CC7EA6DB1828"
  20. }

最後更新:2016-11-23 17:16:03

  上一篇:go 切換SQL采集狀態__日誌管理_API 參考_雲數據庫 RDS 版-阿裏雲
  下一篇:go 查詢SQL審計文件列表__日誌管理_API 參考_雲數據庫 RDS 版-阿裏雲