DescribeLoadBalancerLog

Last updated: 2021-04-09 19:58:17

    API Description

    This API is used to query the CLB layer-7 log in COS. It is applicable to public network CLB instances with HTTP or HTTPS listener configured and COS log enabled.

    Domain name for API calls: lb.api.qcloud.com

    Note that this API only supports querying COS log, but not CLS log. To query the CLS log, call the Searching for Log API, which can be used to query the forwarding logs of a CLB instance over the last three days, including logs forwarded to the RS and those directly returned from the CLB due to RS exception. Interval between requests shall be within one day.

    Request Parameters

    The list below contains only the API request parameters. Common parameters should be added when you call the API. For more information, see the Common Request Parameters. The Action field for this API is DescribeLoadBalancerLog.

    Parameter Required Type Description
    loadBalancerId Yes String CLB instance ID, which can be queried via the DescribeLoadBalancers API.
    order No String Log sequence by timestamp. Valid values: desc and asc. Default value: desc.
    startTime No Int Time when you start querying logs using Unix timestamp (accurate to seconds). The default is 5 minutes earlier than endTime.
    endTime No Int Time when you finish querying logs using Unix timestamp (accurate to seconds). The default is the current timestamp.
    offset No Int Log offset. Value range: [0,10000].
    limit No Int Number of logs. Value range: [0,500].
    filter No Array Filter condition of logs in key-value pairs. See the valid values for the key of filter array below for supported fields.

    Valid values for the key of filter array:

    Key Required Type Description
    status No Int Logs with the status code matching value are returned to the client.
    status_not No Int Logs except those with the status code matching value are returned to the client.
    server_name No String Logs with the domain name in the CLB rules matching value are returned.
    server_name_not No String Logs except those with the domain name in the CLB rules matching value are returned.
    http_host No String Logs with the domain name of http request matching value are returned.
    http_host No String Logs except those with the domain name of http request matching value are returned.
    remote_addr No String Logs with the request client IP matching value are returned.
    remote_addr_not No String Logs except those with the request client IP matching value are returned.
    request_time_less_than No String Logs with the request processing time less than value are returned. This parameter must be passed in along with request_time_greater_than.
    request_time_greater_than No String Logs with the request processing time greater than value are returned. This parameter must be passed in along with request_time_less_than.

    Response Parameters

    Parameter Type Description
    code Int Common error code. 0: success; other values: failure. For more information, see Common Error Codes.
    message String API-related module error message description.
    codeDesc String Error code. For a successful operation, "Success" is returned. For a failed operation, a message describing the failure is returned.
    logInfo Json Information of the log returned.

    logInfo format:

    Parameter Type Description
    logList Array Log array.
    total Int Total number of logs.

    logList data format:

    No. Parameter Type Description
    1 server_name String Domain name configured in the CLB layer-7 rules.
    2 request String Re