• 热门
  • 基础
  • 数据库
  • 安全
  • 大数据
  • 人工智能
  • 混合云
  • 开发与运维
  • 企业应用

应用服务

行业引擎

全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

查询慢日志

最近更新时间:2024-11-29 19:10:42

AnalyzeSlowDaily

根据缓存服务id查询慢日志信息

请求方式

POST

请求参数

英文名称

中文名称

类型

是否必填

备注

Action

调用接口名称

String

固定为当前接口名称。

示例值:AnalyzeSlowDaily

Version

API版本号

String

固定为当前接口版本号。

示例值:2016-07-01

CacheId

缓存服务ID

String

实例ID。

示例值:ac266ae8-xxxx-xxxx-xxxx-db6d761b87eb

StartQueryTime

慢日志采集开始时间

Date

时间格式:yyyy-MM-dd HH:mm:ss

默认查询近24小时数据

仅支持选择3天以内的时间,且小于慢日志采集结束时间

示例值:2024-10-11 10:40:22

EndQueryTime

慢日志采集结束时间

Date

时间格式:yyyy-MM-dd HH:mm:ss

默认查询近24小时数据

仅支持选择3天以内的时间,且大于慢日志采集开始时间

示例值:2024-10-11 10:50:22

PageNum

页码

Integer

表示从(PageNum-1)*PageSize+1条数据开始查询(例如PageNum为2,PageSize为20,表示从第21条开始查,最大查询20条),可输入大于0的正整数,默认为1。

示例值:5

PageSize

分页大小

Integer

每页可展示记录上限,可输入正整数,默认值为10。

示例值:20

ShardId

节点ID

String

主从实例不需要填写;自定义集群实例,可选填写Proxy节点ID或是Shard节点ID,填写则查询所传节点的日志;企业版可选填写Proxy节点ID,填写则查询所传节点的日志;默认查询全部。

示例值:c95709f3-xxxx-xxxx-xxxx-7dea73cddb5c

OperationType

操作类型

String

筛选不同操作类型的日志数据,如LATENCY GET STATS ALL 等,查询多种类型使用“,”分隔。

示例值:LATENCY,GET

返回结果

英文名称

中文名称

类型

备注

RequestId

请求ID

String

示例值:41bb5818-xxxx-xxxx-xxxx-2e2da6c80857

Data

慢日志信息

Object

-

请求示例

curl -X POST
'http://kcs.api.ksyun.com/?Action=AnalyzeSlowDaily&Version=2016-07-01'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: kcs.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'CacheId=xxx&StartQueryTime=xxx&EndQueryTime=xxx&PageNum=xxx&PageSize=xxx&ShardId=xxx&IsProxy=xxx&OperationType=xxx'

响应示例

{
    "RequestId": "41bb5818-xxxx-xxxx-xxxx-2e2da6c80857",
    "Data": {
        "result": [
            {
                "agent": {
                    "hostname": "my_test--1",
                    "type": "fluentbit",
                    "version": "3"
                },
                "hostIP": "xxx.xxx.xxx.xxx",
                "esid": "eaacc1a7-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx-57195",
                "fileset": {
                    "name": "slowlog"
                },
                "message": "slowlog get 1",
                "redis": {
                    "slowlog": {
                        "duration": {
                            "us": 3
                        },
                        "args": [
                            "1"
                        ],
                        "id": 57195,
                        "cmd": "slowlog",
                        "key": "get"
                    }
                },
                "input": {
                    "type": "redis"
                },
                "cluster_id": "0acceabb-xxxx-xxxx-xxxx-e040b9a9b97d",
                "@timestamp": "2024-11-29T09:13:22.000Z",
                "instance_id": "a81ed2f5-xxxx-xxxx-xxxx-f2ba3df37789",
                "service": {
                    "type": "redis"
                },
                "shard_id": "331dbd17-xxxx-xxxx-xxxx-6e738affa409",
                "host": {
                    "name": "my_test--1"
                },
                "event": {
                    "created": "2024-11-29T09:13:22.989Z",
                    "module": "redis",
                    "dataset": "redis.slowlog"
                },
                "timestamp": 1732871602
            },
            {
                "agent": {
                    "hostname": "my_test--1",
                    "type": "fluentbit",
                    "version": "3"
                },
                "hostIP": "xxx.xxx.xxx.xxx",
                "esid": "eaacc1a7-xxxx-xxxx-xxxx-xxxxxxxxxxx-57197",
                "message": "latencylog get 1",
                "fileset": {
                    "name": "slowlog"
                },
                "redis": {
                    "slowlog": {
                        "args": [
                            "1"
                        ],
                        "duration": {
                            "us": 2
                        },
                        "id": 57197,
                        "cmd": "latencylog",
                        "key": "get"
                    }
                },
                "input": {
                    "type": "redis"
                },
                "cluster_id": "0acceabb-xxxx-xxxx-xxxx-e040b9a9b97d",
                "@timestamp": "2024-11-29T09:13:22.000Z",
                "instance_id": "a81ed2f5-xxxx-xxxx-xxxx-f2ba3df37789",
                "service": {
                    "type": "redis"
                },
                "shard_id": "331dbd17-xxxx-xxxx-xxxx-6e738affa409",
                "host": {
                    "name": "my_test--1"
                },
                "event": {
                    "created": "2024-11-29T09:13:22.989Z",
                    "module": "redis",
                    "dataset": "redis.slowlog"
                },
                "timestamp": 1732871602
            },
            {
                "agent": {
                    "hostname": "my_test--5",
                    "type": "fluentbit",
                    "version": "3"
                },
                "hostIP": "xxx.xxx.xxx.xxx",
                "esid": "dba60bc2-xxxx-xxxx-xxxx-xxxxxxxxxxx-56095",
                "fileset": {
                    "name": "slowlog"
                },
                "message": "slowlog get 1",
                "redis": {
                    "slowlog": {
                        "duration": {
                            "us": 3
                        },
                        "args": [
                            "1"
                        ],
                        "id": 56095,
                        "cmd": "slowlog",
                        "key": "get"
                    }
                },
                "input": {
                    "type": "redis"
                },
                "cluster_id": "0acceabb-xxxx-xxxx-xxxx-e040b9a9b97d",
                "@timestamp": "2024-11-29T09:13:22.000Z",
                "instance_id": "42fc4819-xxxx-xxxx-xxxx-22f7e169d1de",
                "service": {
                    "type": "redis"
                },
                "shard_id": "efa876c5-xxxx-xxxx-xxxx-613145593c06",
                "host": {
                    "name": "my_test--5"
                },
                "event": {
                    "created": "2024-11-29T09:13:22.989Z",
                    "module": "redis",
                    "dataset": "redis.slowlog"
                },
                "timestamp": 1732871602
            }
        ],
        "totalPage": 3070,
        "totalCount": 9210,
        "currentPage": 1
    }
}

纯净模式常规模式

纯净模式

点击可全屏预览文档内容
文档反馈

聆听反馈