Modifies a metric for the logs that are imported from Log Service.
This topic provides an example on how to modify 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.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyHybridMonitorTask |
The operation that you want to perform. Set the value to ModifyHybridMonitorTask. |
TaskId | String | Yes | 36**** |
The ID of the metric import task. For information about how to obtain the ID of a metric import task, see DescribeHybridMonitorTaskList. |
TaskName | String | No | SLS_task |
The name of the metric import task. For information about how to obtain the ID of a metric import task, see DescribeHybridMonitorTaskList. |
Description | String | No | Monitoring data of logs from Log Service |
The description of the metric import task. |
CollectInterval | String | No | 15 |
The interval at which metrics are collected. Valid values:
Unit: seconds. |
AttachLabels.N.Value | String | No | testValue |
The tag value of the metric. |
AttachLabels.N.Name | String | No | app_service |
The tag key of the metric. |
SLSProcessConfig | Object | No |
The configurations of the logs that are imported from Log Service. |
|
Filter | Object | No |
The conditions that are used to filter logs imported from Log Service. |
|
Relation | String | No | and |
The relationship between multiple filter conditions. Valid values:
|
Filters | Array | No |
None. |
|
SLSKeyName | String | No | code |
The name of the key that is used to filter logs imported from Log Service. |
Operator | String | No | = |
The method that is used to filter logs imported from Log Service. Valid values:
|
Value | String | No | 200 |
The value of the key that is used to filter logs imported from Log Service. |
Statistics | Array | No |
None. |
|
SLSKeyName | String | No | name |
The name of the key that is used to aggregate logs imported from Log Service. |
Function | String | No | count |
The function that is used to aggregate the log data of a statistical period. Valid values:
|
Alias | String | No | level_count |
The alias of the aggregation result. |
Parameter1 | String | No | 200 |
The value of the function that is used to aggregate logs imported from Log Service.
|
Parameter2 | String | No | 299 |
The value of the function that is used to aggregate logs imported from Log Service. Note This parameter is required only if you set the
Function parameter 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.
|
GroupBy | Array | No |
The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. |
|
SLSKeyName | String | No | code |
The name of the key that is used to aggregate logs imported from Log Service. |
Alias | String | No | ApiResult |
The alias of the aggregation result. |
Express | Array | No |
The extended field that specifies the result of basic operations performed on aggregation results. |
|
Express | String | No | success_count |
The extended field that specifies the result of basic operations performed on aggregation results. |
Alias | String | No | SuccRate |
The alias of the extended field that specifies the result of basic operations performed on aggregation results. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | 200 |
The HTTP status code. Note The status code 200 indicates that the call was successful.
|
Message | String | Invalid.SLSConfig |
The error message. |
RequestId | String | 11145B76-566A-5D80-A8A3-FAD98D310079 |
The ID of the request. |
Success | String | true |
Indicates whether the call was successful. Valid values:
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=ModifyHybridMonitorTask
&TaskId=36****
&TaskName=SLS_task
&CollectInterval=15
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyHybridMonitorTaskResponse>
<RequestId>11145B76-566A-5D80-A8A3-FAD98D310079</RequestId>
<Code>200</Code>
<Success>true</Success>
</ModifyHybridMonitorTaskResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "11145B76-566A-5D80-A8A3-FAD98D310079",
"Code" : 200,
"Success" : true
}
Error codes
For a list of error codes, visit the API Error Center.