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.
Debugging
Authorization information
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. | |
CollectInterval | string | No | The collection period of the metric. Valid values:
Unit: seconds. | 15 |
AttachLabels | object [] | No | The tags of the metric. | |
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 Log Service. | |
Filter | object | No | The conditions that are used to filter logs imported from Log Service. | |
Relation | string | No | The relationship between multiple filter conditions. Valid values:
| and |
Filters | object [] | No | None | |
SLSKeyName | string | No | The name of the key that is used to filter logs imported from Log Service. | code |
Operator | string | No | The method that is used to filter logs imported from Log Service. Valid values:
| = |
Value | string | No | The value of the key that is used to filter logs imported from Log Service. | 200 |
Statistics | object [] | No | None | |
SLSKeyName | string | No | The name of the key that is used to aggregate logs imported from Log Service. | name |
Function | string | No | The function that is used to aggregate the log data of a statistical period. Valid values:
| 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 Log Service.
| 200 |
Parameter2 | string | No | The value of the function that is used to aggregate logs imported from Log Service. Note
This parameter must be specified when Function 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 | object [] | No | The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. | |
SLSKeyName | string | No | The name of the key that is used to aggregate logs imported from Log Service. | code |
Alias | string | No | The alias of the aggregation result. | ApiResult |
Express | object [] | No | The extended fields that specify the results of basic operations performed on aggregation results. | |
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 parameters
Examples
Sample success responses
JSON
format
{
"Code": "200",
"Message": "Invalid.SLSConfig",
"RequestId": "11145B76-566A-5D80-A8A3-FAD98D310079",
"Success": "true"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | %s | %s |
500 | InternalError | %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
2022-07-11 | The Error code has changed | see changesets | ||||||||||
|