调用DescribeLogMonitorAttribute接口获取日志监控详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
 调试
        
            调试
        
    
授权信息
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
| MetricName | string | 是 | 指标名称。 | cpu_total_****** | 
返回参数
| 名称 | 类型 | 描述 | 示例值 | 
| object | |||
| Code | string | 状态码。 说明 
 200 表示成功。 | 200 | 
| Message | string | 返回信息。 | The specified resource is not found. | 
| RequestId | string | 请求 ID。 | C6718537-E673-4A58-8EE1-24B8B38C7AAE | 
| Success | boolean | 操作是否成功。取值: 
 | true | 
| LogMonitor | object | 日志监控详情。 | |
| ValueFilterRelation | string | 日志筛选的过滤条件。需要和 ValueFilter 配合使用。取值: 
 | and | 
| SlsLogstore | string | 日志服务 Logstore 名称。 | logstore_****** | 
| MetricName | string | 监控项的名称。 | cpu_total_****** | 
| GroupId | integer | 应用分组 ID。 | 123****** | 
| LogId | integer | 日志监控 ID。 | 123****** | 
| MetricExpress | string | 指标表达式。 | {} | 
| SlsRegionId | string | 日志服务所在的地域 id。 | cn-hangzhou | 
| GmtCreate | integer | 创建时间。 格式为 Unix 时间戳,即从 1970 年 1 月 1 日开始所经过的秒数。 | 1678440033000 | 
| SlsProject | string | 日志服务 Project 名称。 | project_****** | 
| Aggregates | array<object> | 聚合计算定义。 | |
| object | 聚合计算定义。 | ||
| Max | string | 最大值。 | 0 | 
| Min | string | 最小值。 | 0 | 
| Function | string | 统计方法,即在统计周期内计算日志数据的函数方法。取值: 
 | count | 
| Alias | string | 字段别名。 | alias_****** | 
| FieldName | string | 日志中原始的字段名。 | field_****** | 
| ValueFilter | array<object> | 筛选的过滤规则,配合 ValueFilterRelation 使用。相当于 SQL 中的 Where 条件。 如果不填写,则表示对全部数据进行处理。例如:日志中有 Level 和 Error 字段,如果需要统计每分钟 Error 出现的次数,则统计方法可以定义为对 Level 求和,并且 Level=Error。 | |
| object | 筛选的过滤规则。 | ||
| Key | string | key | key_****** | 
| Value | string | value | value_****** | 
| Operator | string | 字段值的匹配方式。取值: 
 | contain | 
| Tumblingwindows | array | 预计算窗口时间。单位:秒。云监控将在定义的预计算时间对数据做一次聚合计算。 | |
| string | 预计算窗口时间。单位:秒。云监控将在定义的预计算时间对数据做一次聚合计算。 | 60 | |
| Groupbys | array | 对数据进行空间维度聚合。相当于 SQL 中的 Group By,根据指定的维度,对监控数据进行分组。如果 Group By 不选择任何维度,则根据聚合方法对全部监控数据进行聚合。 | |
| string | group by 定义 | userId | 
示例
正常返回示例
JSON格式
{
  "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"
    ]
  }
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 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. | 未找到指定资源。 | 
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。