All Products
Search
Document Center

CloudMonitor:DescribeLogMonitorList

Last Updated:Jul 26, 2024

Queries log monitoring metrics.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cms:DescribeLogMonitorListget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberintegerNo

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return on each page. Default value: 10

10
SearchValuestringNo

The keyword that is used to search for log monitoring metrics. Fuzzy match is supported.

test
GroupIdlongNo

The ID of the application group.

123456

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

01E90080-4300-4FAA-B9AE-161956BC350D
Successboolean

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.
true
Codestring

The HTTP status code.

Note The status code 200 indicates that the call was successful.
200
Messagestring

The returned message.

successful
PageSizeinteger

The number of entries returned on each page.

10
PageNumberinteger

The number of the returned page.

1
Totallong

The total number of the returned entries.

15
LogMonitorListarray<object>

The log monitoring metrics.

object
ValueFilterRelationstring

The logical operator that is used between log filter conditions. The ValueFilter and ValueFilterRelation parameters are used in pair. Valid values:

  • and
  • or
and
SlsLogstorestring

The name of the Log Service Logstore.

testSlS****
MetricNamestring

The name of the log monitoring metric. For more information, see Appendix 1: Metrics.

cpu_total
GroupIdlong

The ID of the application group.

12345
LogIdlong

The ID returned by Log Service.

12345
SlsRegionIdstring

The ID of the region where the Log Service Logstore resides.

cn-hangzhou
GmtCreatelong

The time when the log monitoring metric was created.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

1577766395000
SlsProjectstring

The name of the Log Service project.

sls-project-test****
ValueFilterarray<object>

The condition that is used to filter logs. The ValueFilter and ValueFilterRelation parameters are used in pair. The filter condition is equivalent to the WHERE clause in SQL statements.

If no filter condition is specified, all logs are processed. Assume that logs contain the Level field, which may be set to Error. If you need to calculate the number of times that logs of the Error level appear every minute, you can set the filter condition to Level=Error and count the number of logs that meet this condition.

object
Keystring

The name of the log field used for matching in the filter condition.

hostName
Valuestring

The field value to be matched in the filter condition.

portal
Operatorstring

The method that is used to match the field value. Valid values:

  • contain
  • notContain
  • >: greater than
  • <: less than
  • >=: greater than or equal to
  • <=: less than or equal to
contain

Examples

Sample success responses

JSONformat

{
  "RequestId": "01E90080-4300-4FAA-B9AE-161956BC350D",
  "Success": true,
  "Code": "200",
  "Message": "successful",
  "PageSize": 10,
  "PageNumber": 1,
  "Total": 15,
  "LogMonitorList": [
    {
      "ValueFilterRelation": "and",
      "SlsLogstore": "testSlS****",
      "MetricName": "cpu_total",
      "GroupId": 12345,
      "LogId": 12345,
      "SlsRegionId": "cn-hangzhou",
      "GmtCreate": 1577766395000,
      "SlsProject": "sls-project-test****",
      "ValueFilter": [
        {
          "Key": "hostName",
          "Value": "portal",
          "Operator": "contain"
        }
      ]
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterInvalidIllegal parameters.-
403AccessForbiddenUser not authorized to operate on the specified resource.-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
500InternalErrorThe request processing has failed due to some unknown error.-

For a list of error codes, visit the Service error codes.