DescribeInstanceLogs

Last updated: 2019-09-09 21:30:37

1. API Description

API domain name: es.tencentcloudapi.com.

This API describes ES cluster logs eligible in the specified region.

Default API request rate limit: 20 requests/sec.

Note: This API supports financial regions. As financial regions and non-financial regions are isolated, if a financial region, such as ap-shanghai-fsi, is assigned to the common parameter Region, we recommend you include that financial region in your domain name , such as es.ap-shanghai-fsi.tencentcloudapi.com.

2. Input Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The name of this API: DescribeInstanceLogs
Version Yes String Common parameter. The version of this API: 2018-04-16
Region Yes String Common parameter. For more information, see the list of regions supported by the product.
InstanceId Yes String Cluster instance ID
LogType No Integer Log type; 1 by default
  • 1: Master log
  • 2: Search slow log
  • 3: Index slow log
  • 4: GC log
  • SearchKey No String Search keyword, which supports LUCENE syntax, such as level:WARN, ip:1.1.1.1, and message:test-index
    StartTime No String Log start time; the format is YYYY-MM-DD HH:MM:SS, such as 2019-01-22 20:15:53
    EndTime No String Log end time; the format is YYYY-MM-DD HH:MM:SS, such as 2019-01-22 20:15:53
    Offset No Integer Pagination start value; 0 by default
    Limit No Integer Number of entries per page; 100 by default; up to 100
    OrderByType No Integer Time sorting order; 0 by default
  • 0: Descending
  • 1: Ascending
  • 3. Output Parameters

    Parameter name Type Description
    TotalCount Integer Number of returned logs
    InstanceLogList Array of InstanceLog List of log details
    RequestId String The unique ID of a request, which is required for each troubleshooting case.

    4. Examples

    Example 1. Querying ES Cluster Logs

    Query the latest master logs of a cluster

    Input Sample Code

    https://es.tencentcloudapi.com/?Action=DescribeInstanceLogs
    &InstanceId=es-f5mwm28u
    &<Common request parameter>

    Output Sample Code

    {
      "Response": {
        "TotalCount": 71633,
        "InstanceLogList": [
          {
            "Time": "2019-01-22T10:45:36.220+08:00",
            "Ip": "10.0.128.65",
            "Level": "INFO",
            "Message": "[o.e.p.o.OPackActionFilter] [1547723102001286009] forbidden request: { ID:cdc62072721547678872c0448c1ecaf9, TYP:MainRequest, USR:null, BRS:false, ACT:cluster:monitor/main, OA:10.0.128.43, IDX:, MET:GET, PTH:/, CNT:<OMITTED, LENGTH=0>, HDR:content-length, EFF:0 } Reason: null"
          },
          {
            "Time": "2019-01-22T10:45:35.730+08:00",
            "Ip": "10.0.128.65",
            "Level": "INFO",
            "Message": "[o.e.p.o.OPackActionFilter] [1547723102001286009] forbidden request: { ID:1a8a5b7ea41a485ebdd769586c1dcdf6, TYP:MainRequest, USR:null, BRS:false, ACT:cluster:monitor/main, OA:10.0.128.73, IDX:, MET:GET, PTH:/, CNT:<OMITTED, LENGTH=0>, HDR:content-length, EFF:0 } Reason: null"
          }
        ],
        "RequestId": "783d9290-dc60-4862-9340-10b632605374"
      }
    }

    5. Developer Resources

    API Explorer

    This tool provides various capabilities such as online call, signature verification, SDK code generation, and quick API retrieval that significantly reduce the difficulty of using TencentCloud API.

    SDK

    TencentCloud API 3.0 integrates software development toolkits (SDKs) that support various programming languages to make it easier for you to call the APIs.

    TCCLI

    6. Error Codes

    The following error codes are API business logic-related. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError Internal error.
    InvalidParameter Incorrect parameter.