最近更新时间:2024-11-29 19:10:42
根据缓存服务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
}
}
纯净模式