All Products
Search
Document Center

Cloud Monitor:ModifyHybridMonitorTask

Last Updated:Mar 30, 2026

Modifies a metric for the logs that are imported from Log Service.

Operation description

This topic provides an example on how to change the collection period of a metric import task whose ID is 36**** to 15 seconds. The task is used to monitor the logs that are imported from Log Service. The returned result indicates that the metric is modified.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

TaskId

string

Yes

The ID of the metric import task.

For information about how to obtain the ID of a metric import task, see DescribeHybridMonitorTaskList.

36****

TaskName

string

No

The name of the metric import task.

For information about how to obtain the ID of a metric import task, see DescribeHybridMonitorTaskList.

SLS_task

Description

string

No

The description of the metric import task.

SLSLog monitoring data.

CollectInterval

string

No

The collection period of the metric. Valid values:

  • 15

  • 60

Unit: seconds.

15

AttachLabels

array<object>

No

The tags of the metric.

object

No

None

Value

string

No

The tag value of the metric.

testValue

Name

string

No

The tag key of the metric.

app_service

SLSProcessConfig

object

No

The configurations of the logs that are imported from Simple Log Service.

Filter

object

No

The conditions that are used to filter logs imported from Simple Log Service.

Relation

string

No

The relationship between multiple filter conditions. Valid values:

  • and (default): Logs are processed only if all filter conditions are met.

  • or: Logs are processed if one of the filter conditions is met.

and

Filters

array<object>

No

None.

object

No

None.

SLSKeyName

string

No

The name of the key that is used to filter logs imported from Simple Log Service.

code

Operator

string

No

The method that is used to filter logs imported from Simple Log Service. Valid values:

  • contain: contains

  • notContain: does not contain

  • >: greater than

  • <: less than

  • =: equal to

  • ! =: not equal to

  • >=: greater than or equal to

  • <=: less than or equal to

=

Value

string

No

The value of the key that is used to filter logs imported from Simple Log Service.

200

Statistics

array<object>

No

None.

object

No

None.

SLSKeyName

string

No

The name of the key that is used to aggregate logs imported from Simple Log Service.

name

Function

string

No

The function that is used to aggregate the log data of a statistical period. Valid values:

  • count: counts the number.

  • sum: calculates the total value.

  • avg: calculates the average value.

  • max: calculates the maximum value.

  • min: calculates the minimum value.

  • value: collects samples within the statistical period.

  • countps: calculates the number of values of the specified field divided by the total number of seconds within the statistical period.

  • sumps: calculates the sum of the values of the specified field divided by the total number of seconds within the statistical period.

  • distinct: calculates the number of unique values of the specified field within the statistical period.

  • distribution: calculates the number of logs that meet a specified condition within the statistical period.

  • percentile: sorts the values of the specified field in ascending order, and then returns the value that is at the specified percentile within the statistical period. Example: P50.

count

Alias

string

No

The alias of the aggregation result.

level_count

Parameter1

string

No

The value of the function that is used to aggregate logs imported from Simple Log Service.

  • If the Function parameter is set to distribution, this parameter specifies the lower limit of the statistical interval. For example, if you want to calculate the number of HTTP requests whose status code is 2XX, set this parameter to 200.

  • If the Function parameter is set to percentile, this parameter specifies the percentile at which the expected value is. For example, 0.5 specifies P50.

200

Parameter2

string

No

The value of the function that is used to aggregate logs imported from Simple Log Service.

Note

This parameter is required only if the Function parameter is set to distribution. This parameter specifies the upper limit of the statistical interval. For example, if you want to calculate the number of HTTP requests whose status code is 2XX, set this parameter to 299.

299

GroupBy

array<object>

No

The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL.

object

No

None.

SLSKeyName

string

No

The name of the key that is used to aggregate logs imported from Simple Log Service.

code

Alias

string

No

The alias of the aggregation result.

ApiResult

Express

array<object>

No

The extended fields that specify the results of basic operations performed on aggregation results.

object

No

None.

Express

string

No

The extended field that specifies the result of basic operations performed on aggregation results.

success_count

Alias

string

No

The alias of the extended field that specifies the result of basic operations performed on aggregation results.

SuccRate

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

None

Code

string

The status code.

Note

The status code 200 indicates that the request was successful.

200

Message

string

The error message.

Invalid.SLSConfig

RequestId

string

The request ID.

11145B76-566A-5D80-A8A3-FAD98D310079

Success

string

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "Invalid.SLSConfig",
  "RequestId": "11145B76-566A-5D80-A8A3-FAD98D310079",
  "Success": "true"
}

Error codes

HTTP status code

Error code

Error message

Description

400 %s %s
500 %s %s
500 InternalError %s
403 %s %s
404 %s %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.