LookUpEvents

Last updated: 2020-02-15 11:44:33

1. API Description

Domain name for API request: cloudaudit.tencentcloudapi.com.

This API is used to search for operation logs to help query relevant operation information.

A maximum of 200 requests can be initiated per second for this API.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: LookUpEvents
Version Yes String Common parameter. The value used for this API: 2019-03-19
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
EndTime Yes Integer End time
StartTime Yes Integer Start time
LookupAttributes.N No Array of LookupAttribute Search criteria
MaxResults No Integer Maximum number of logs that can be returned
NextToken No String Credential for viewing more logs

3. Output Parameters

Parameter Name Type Description
Events Array of Event Logset
ListOver Boolean Whether the logset ends
NextToken String Credential for viewing more logs
RequestId String Unique ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Example

Example1 Searching for Logs

Search for operation logs to help query relevant operation information.

Input Example

https://cloudaudit.tencentcloudapi.com/?Action=LookUpEvents
&EndTime=1553056687
&LookupAttributes.0.AttributeKey=AccessKeyId
&LookupAttributes.0.AttributeValue=AKID7JETaYT3IAmutX0vXCcy4q90zJNvlVZf
&StartTime=1553056487
&<Common request parameter>

Output Example

{
    "Response": {
        "Events": [
            {
                "CloudAuditEvent": "{"actionType":"Read","apiErrorCode":"","apiErrorMessage":"","apiVersion":"2.0","errorCode":0,"errorMessage":"permission verify","eventID":"e92a92fc259c4a9333d2a7ce64d1ef201","eventName":"LookupEvents","eventRegion":"ap-guangzhou","eventSource":"cloudaudit.api.tencentyun.com/v2/index.php","eventTime":"2019-03-20 12:36:27","eventType":"ConsoleCall","eventVersion":2,"httpMethod":"POST","region":"","requestID":"15936031437374_1553056587.6815_v2","requestParameters":"{"Action":"LookupEvents","EndTime":"1553097599","MaxResults":"10","Nonce":"36881","Region":"gz","RequestClient":"SDK_NODEJS_0.2.1","RequestOperator":"1150691759","RequestSource":"MC","SecretId":"AKID7JETaYT3IAmutX0vXCcy4q90zJNvlVZf","StartTime":"1552406400","Timestamp":"1553056583","Token":"147d2c5b0319541a13d9fe6ceb5af2aae9b67f6610001","seqId":"cdb9c38c-7031-bb13-6a9c-cd7641734c8f"}","resourceName":"","resourceType":"cloudaudit","resources":"","sourceIPAddress":"59.37.125.124","userAgent":"","userIdentity":{"userName":"root","type":"Root","secretId":"AKID7JETaYT3IAmutX0vXCcy4q90zJNvlVZf","accountId":1150691759,"principalId":1150691759,"sessionContext":{"expireTime":"2019-03-20 13:04:46","hasPolicyFilter":0,"extraInfo":"","interfaceName":"","ownerUin":1150691759,"ua":"27513f02ea3ab649f0cacb6476df54eb","mfa":0,"userIp":"59.37.125.124","mfaExpireTime":"2019-03-20 12:34:46","uin":1150691759,"token":"147d2c5b0319541a13d9fe6ceb5af2aae9b67f6610001","appId":1251840716,"policyFilter":""}}}",
                "EventId": "e92a92fc259c4a9333d2a7ce64d1ef201",
                "EventName": "LookupEvents",
                "EventTime": "2019-03-20 12:36:27",
                "SecretId": "AKID7JETaYT3IAmutX0vXCcy4q90zJNvlVZf",
                "ErrorCode": 0,
                "RequestID": "15936031437374_1553056587.6815_v2",
                "AccountID": 1150691759,
                "SourceIPAddress": "59.37.125.124",
                "EventSource": "cloudaudit.api.tencentyun.com/v2/index.php",
                "EventRegion": "ap-guangzhou",
                "Resources": {
                    "ResourceName": "",
                    "ResourceType": "cloudaudit"
                },
                "Username": "root",
                "ResourceTypeCn": "CloudAudit",
                "EventNameCn": "Search for logs"
            }
        ],
        "NextToken": "DnF1ZXJ5VGhlbkZldGNoDwAAAAAAACBuFjNoRHJ5YTd4U1B5YWY4c1ZmMmxBQWcAAAAAAAAgnBZZZkZoYy04LVJJeVpJNnZJS2hIVTdRAAAAAAAAI1QWYk5mQmZXTzhTWXFNZjFMVlhHY1RjdwAAAAAAAB9sFmhZbV8xbm1FUXE2NGVDQndWSlNoMncAAAAAAAAd9BZOelN1aGMycFNydUVEQ0dQbzdCcEZBAAAAAAAALroWMTh4c00xalhRbk9wR0NsYWZvV20tQQAAAAAAACCdFllmRmhjLTgtUkl5Wkk2dklLaEhVN1EAAAAAAAAuuRYxOHhzTTFqWFFuT3BHQ2xhZm9XbS1BAAAAAAAAIJ4WWWZGaGMtOC1SSXlaSTZ2SUtoSFU3UQAAAAAAAB81FnN5aTBfTWJKU25HdXZuMWxsRkdJZ3cAAAAAAAApMhZ1UjdybjlCY1NRYUZVYWRub2x4YW9RAAAAAAAAHzQWc3lpMF9NYkpTbkd1dm4xbGxGR0lndwAAAAAAAB31Fk56U3VoYzJwU3J1RURDR1BvN0JwRkEAAAAAAAAfbRZoWW1fMW5tRVFxNjRlQ0J3VkpTaDJ3AAAAAAAAH24WaFltXzFubUVRcTY0ZUNCd1ZKU2gydw==",
        "ListOver": true,
        "RequestId": "91e2998d-edc0-4ba0-a76d-cebbbfd99391"
    }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError.SearchError Internal error. Please submit a ticket.
InvalidParameter.Time The parameter must contain the start time and end time and must be an integer timestamp (accurate to the second).
InvalidParameterValue.MaxResult The maximum number of entries returned by one search is 50.
InvalidParameterValue.Time The start time cannot be later than the end time.
InvalidParameterValue.attributeKey AttributeKey value range: RequestId, EventName, ReadOnly, Username, ResourceType, ResourceName, AccessKeyId.
LimitExceeded.OverTime Only entries in the past 7 days can be searched for.