All Products
Search
Document Center

Cloud Monitor:ModifyHybridMonitorTask

Last Updated:Jun 13, 2026

Modifies the metrics of a Simple Log Service (SLS) log monitoring task by calling the ModifyHybridMonitorTask operation.

Operation description

This topic provides an example on how to change the collection interval of the SLS log monitoring task 36**** to 15 seconds. The response shows 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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:ModifyHybridMonitorTask

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TaskId

string

Yes

The monitoring task ID.

For information about how to obtain the monitoring task ID, see DescribeHybridMonitorTaskList.

36****

TaskName

string

No

The monitoring task name.

For information about how to obtain the monitoring task ID, see DescribeHybridMonitorTaskList.

SLS_task

Description

string

No

The description of the monitoring task.

SLS log monitoring data.

CollectInterval

string

No

The collection interval 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 SLS log configuration.

Filter

object

No

The filter conditions for parameters in the SLS log.

Relation

string

No

The relationship between multiple filter conditions. Valid values:

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

  • or: Logs are processed when any filter condition 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 parameter for SLS log statistics.

name

Function

string

No

The statistical method used to aggregate log data within a statistical period. Valid values:

  • count: counts the number of occurrences.

  • sum: calculates the sum.

  • avg: calculates the average.

  • max: returns the maximum value.

  • min: returns the minimum value.

  • value: samples within the period.

  • countps: calculates the per-second average of the count for the specified field within the statistical period.

  • sumps: calculates the per-second average of the sum for the specified field within the statistical period.

  • distinct: calculates the number of occurrences of the specified field after deduplication within the statistical period.

  • distribution: calculates the number of occurrences of field values within a specified range.

  • percentile: calculates the distribution value of field values, such as P50.

count

Alias

string

No

The alias of the SLS log statistics result.

level_count

Parameter1

string

No

The statistical value of the SLS log.

  • If Function is set to distribution, this parameter specifies the lower limit of the statistical range. For example, to count the number of 2XX HTTP status codes, set this parameter to 200.

  • If Function is set to percentile, this parameter specifies the percentile of the statistical distribution. For example, 0.5 indicates P50.

200

Parameter2

string

No

The statistical value of the SLS log.

Note

This parameter is required only when Function is set to distribution. It specifies the upper limit of the statistical range. For example, to count the number of 2XX HTTP status codes, set this parameter to 299.

299

GroupBy

array<object>

No

Aggregates data by spatial dimension, which is equivalent to GROUP BY in SQL.

object

No

None.

SLSKeyName

string

No

The name of the parameter for SLS log statistics.

code

Alias

string

No

The alias of the SLS log statistics result.

ApiResult

Express

array<object>

No

The arithmetic operation result of the extended field in the SLS log statistics result.

object

No

None.

Express

string

No

The arithmetic operation result of the extended field in the SLS log statistics result.

success_count

Alias

string

No

The alias of the arithmetic operation result of the extended field in the SLS log statistics result.

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

200 indicates success.

200

Message

string

The error message.

Invalid.SLSConfig

RequestId

string

The request ID.

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

Success

string

Indicates whether the operation was successful. Valid values:

  • true: The operation was successful.

  • false: The operation failed.

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.