tencent cloud

Feedback

DescribeLogHistogram

Last updated: 2022-10-11 11:33:43

1. API Description

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

This API is used to build a histogram.

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: DescribeLogHistogram.
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.
TopicId Yes String ID of the log topic to be queried
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
Interval No Integer Time interval in milliseconds

3. Output Parameters

Parameter Name Type Description
Interval Integer Statistical period in milliseconds
TotalCount Integer The number of logs that hit the keywords
HistogramInfos Array of HistogramInfo Statistical result details within the period
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Getting the histogram information

Input Example

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

{
    "TopicId": "682d0718-07bb-4ec0-9fda-f1e9a2767e0b",
    "From": 1608794855000,
    "To": 1608794855000,
    "Query": "select *from a",
    "Interval": 10
}

Output Example

{
    "Response": {
        "Interval": 10,
        "TotalCount": 15,
        "HistogramInfos": [
            {
                "Count": 5,
                "BTime": 1619331870
            },
            {
                "Count": 10,
                "BTime": 1619332410
            }
        ],
        "RequestId": "b276cb6e-4687-11eb-b378-0242ac130002"
    }
}

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.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.
OperationDenied.NewSyntaxNotSupported
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