tencent cloud

Feedback

GetAlarmLog

Last updated: 2022-04-20 11:02:08

1. API Description

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

This API is used to get the records of alarm tasks.

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

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

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 Params. The value used for this API: GetAlarmLog.
Version Yes String Common Params. The value used for this API: 2020-10-16.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
From Yes Integer Start time of the log to be queried, which is a Unix timestamp in milliseconds
To Yes Integer End time of the log to be queried, which is a Unix timestamp in milliseconds
Query Yes String Query statement. Maximum length: 1024
Limit No Integer Number of logs returned in a single query. Maximum value: 1000
Context No String This field is used to load more logs. Pass through the last Context value returned to get more log content.
Sort No String Order of the logs sorted by time returned by the log API. Valid values: asc: ascending; desc: descending. Default value: desc
UseNewAnalysis No Boolean If the value is true, the new search method will be used, and the response parameters AnalysisRecords and Columns will be valid. If the value is false, the old search method will be used, and AnalysisResults and ColNames will be valid.

3. Output Parameters

Parameter Name Type Description
Context String Context for loading subsequent content
ListOver Boolean Whether all log query results are returned
Analysis Boolean Whether the return is the analysis result
ColNames Array of String If Analysis is true, column name of the analysis result will be returned; otherwise, empty content will be returned.
Note: this field may return null, indicating that no valid values can be obtained.
Results Array of LogInfo Log query result. If Analysis is True, null may be returned
Note: this field may return null, indicating that no valid values can be obtained.
AnalysisResults Array of LogItems Log analysis result. If Analysis is False, null may be returned
Note: this field may return null, indicating that no valid values can be obtained.
AnalysisRecords Array of String New log analysis result, which will be valid if UseNewAnalysis is true
Note: this field may return null, indicating that no valid values can be obtained.
Columns Array of Column Column attribute of log analysis, which will be valid if UseNewAnalysis is true
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying logs

Input Example

POST / HTTP/1.1
Host: cls.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: GetAlarmLog
<Common request parameters>

{
    "From": "1608894763000",
    "To": "1608894763",
    "Query": "ddddddddd",
    "Limit": 100
}

Output Example

{
  "Response": {
    "AnalysisRecords": [
      "xx"
    ],
    "Results": [
      {
        "PkgId": "xx",
        "TopicId": "xx",
        "FileName": "xx",
        "Source": "xx",
        "LogJson": "xx",
        "Time": 0,
        "TopicName": "xx",
        "PkgLogId": "xx"
      },
      {
        "PkgId": "xx",
        "TopicId": "xx",
        "FileName": "xx",
        "Source": "xx",
        "LogJson": "xx",
        "Time": 0,
        "TopicName": "xx",
        "PkgLogId": "xx"
      }
    ],
    "Analysis": true,
    "ListOver": false,
    "Context": "xx",
    "AnalysisResults": [
      {
        "Data": [
          {
            "Value": "xx",
            "Key": "xx"
          }
        ]
      },
      {
        "Data": [
          {
            "Key": "xx",
            "Value": "xx"
          }
        ]
      },
      {
        "Data": [
          {
            "Key": "xx",
            "Value": "xx"
          }
        ]
      }
    ],
    "ColNames": [
      "time",
      "pv",
      "uv"
    ],
    "Columns": [
      {
        "Type": "xx",
        "Name": "xx"
      }
    ],
    "RequestId": "xx"
  }
}

5. Developer Resources

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
FailedOperation Operation failed.
FailedOperation.GetlogReachLimit The number of searched logs has reached the upper limit.
FailedOperation.InvalidContext The search cursor is invalid or does not exist.
FailedOperation.QueryError The query statement failed to run.
FailedOperation.SearchTimeout The query timed out.
FailedOperation.SyntaxError An error occurred while parsing the query statement.
FailedOperation.TopicIsolated The log topic has been isolated.
InternalError Internal error.
InvalidParameter Incorrect parameter.
LimitExceeded.LogSearch The number of concurrent queries exceeds the limit, which is 15 per topic.
MissingParameter Missing parameter.
OperationDenied Operation denied.
OperationDenied.AccountDestroy The account has been terminated.
OperationDenied.AccountIsolate The account has overdue payments.
OperationDenied.AccountNotExists The account does not exist.
ResourceNotFound.TopicNotExist The log topic does not exist.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support