Queries the details of a Log Monitoring task.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| MetricName |
string |
Yes |
The name of the metric. |
cpu_total_****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. Note
A status code of 200 indicates a successful request. |
200 |
| Message |
string |
The returned message. |
The specified resource is not found. |
| RequestId |
string |
The request ID. |
C6718537-E673-4A58-8EE1-24B8B38C7AAE |
| Success |
boolean |
Indicates whether the operation was successful. Valid values:
|
true |
| LogMonitor |
object |
The details of the Log Monitoring task. |
|
| ValueFilterRelation |
string |
The logical operator for the filter conditions. This parameter is used with `ValueFilter`. Valid values:
|
and |
| SlsLogstore |
string |
The name of the Simple Log Service Logstore. |
logstore_****** |
| MetricName |
string |
The name of the metric. |
cpu_total_****** |
| GroupId |
integer |
The ID of the application group. |
123****** |
| LogId |
integer |
The ID of the Log Monitoring task. |
123****** |
| MetricExpress |
string |
The metric expression. |
{} |
| SlsRegionId |
string |
The ID of the region where Simple Log Service resides. |
cn-hangzhou |
| GmtCreate |
integer |
The time when the task was created. This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970. |
1678440033000 |
| SlsProject |
string |
The name of the Simple Log Service project. |
project_****** |
| Aggregates |
array<object> |
The definitions of aggregations. |
|
|
object |
The definition of an aggregation. |
||
| Max |
string |
The maximum value. |
0 |
| Min |
string |
The minimum value. |
0 |
| Function |
string |
The function that is used to aggregate log data in a statistical period. Valid values:
|
count |
| Alias |
string |
The alias of the field. |
alias_****** |
| FieldName |
string |
The original name of the field in the log. |
field_****** |
| ValueFilter |
array<object> |
The filter conditions. This parameter is used with `ValueFilterRelation`. This parameter is equivalent to the `WHERE` clause in an SQL statement. If you do not specify this parameter, all data is processed. For example, if a log contains a `Level` field and you want to count the number of logs where the value of `Level` is `Error`, you can set the aggregation function to `count` and specify a filter condition where `Level` equals `Error`. |
|
|
object |
The filter condition. |
||
| Key |
string |
The key. |
key_****** |
| Value |
string |
The value. |
value_****** |
| Operator |
string |
The operator that is used to match the field value. Valid values:
|
contain |
| Tumblingwindows |
array |
The pre-aggregation window. Unit: seconds. Cloud Monitor aggregates data in the specified pre-aggregation window. |
|
|
string |
The pre-aggregation window. Unit: seconds. Cloud Monitor aggregates data in the specified pre-aggregation window. |
60 |
|
| Groupbys |
array |
The dimension based on which log data is aggregated. This parameter is equivalent to the `GROUP BY` clause in an SQL statement. You can specify a dimension to group monitoring data. If you do not specify this parameter, all monitoring data is aggregated based on the aggregation method. |
|
|
string |
The `group by` definition |
userId |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "The specified resource is not found.",
"RequestId": "C6718537-E673-4A58-8EE1-24B8B38C7AAE",
"Success": true,
"LogMonitor": {
"ValueFilterRelation": "and",
"SlsLogstore": "logstore_******",
"MetricName": "cpu_total_******",
"GroupId": 0,
"LogId": 0,
"MetricExpress": "{}",
"SlsRegionId": "cn-hangzhou",
"GmtCreate": 1678440033000,
"SlsProject": "project_******",
"Aggregates": [
{
"Max": "0",
"Min": "0",
"Function": "count",
"Alias": "alias_******",
"FieldName": "field_******"
}
],
"ValueFilter": [
{
"Key": "key_******",
"Value": "value_******",
"Operator": "contain"
}
],
"Tumblingwindows": [
"60"
],
"Groupbys": [
"userId"
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.