更新时间:2024-11-18 GMT+08:00

DCS仪表盘模板

分布式缓存服务(Distributed Cache Service,简称DCS)是一款内存数据库服务,兼容了Redis内存数据库引擎,满足用户高并发及数据快速访问的业务诉求。云日志服务提供对各种云资源操作记录的收集、存储和查询功能,可用于支撑安全分析、合规审计、资源跟踪和问题定位等常见应用场景。

云日志服务支持日志采集向导一站式采集DCS日志,DCS审计日志中心仪表盘支持展示访问用户数、访问客户端数、审计日志条数等图表。

前提条件

日志配置结构化,详情请参见设置云端结构化解析日志

DCS审计日志中心

  1. 登录云日志服务控制台,在左侧导航栏中选择“仪表盘”。
  2. 在仪表盘模板下方,选择“DCS仪表盘模板 > DCS审计日志中心”,查看图表详情。

    • 访问用户数图表所关联的查询分析语句如下所示:
      select count(distinct(user)) as user_num
    • 访问客户端数图表所关联的查询分析语句如下所示:
      select count(distinct(client_addr)) as client_num
    • 审计日志条数图表所关联的查询分析语句如下所示:
      select count(1) as log_num
    • 平均响应时间图表所关联的查询分析语句如下所示:
      select avg(use_time) as avg_time
    • 平均QPS图表所关联的查询分析语句如下所示:
      select count(*) / CAST((TIMESTAMPDIFF (minute, MIN(__time),MAX(__time))+1) as FLOAT)
    • TOP5 用户图表所关联的查询分析语句如下所示:
      select user, count(1) as 'user_count' group by user order by count(1) desc LIMIT 5
    • TOP5 客户端图表所关联的查询分析语句如下所示:
      select client_addr, count(1) as 'remote_count' group by client_addr order by count(1) desc limit 5
    • TOP5 执行命令图表所关联的查询分析语句如下所示:
      select command_name, count(1) as 'command_count' group by command_name order by count(1) desc
    • 热Key图表所关联的查询分析语句如下所示:
      SELECT count(*) as 'count',  command_keys GROUP by command_keys order by count(*) desc limit 5
    • 审计日志详情图表所关联的查询分析语句如下所示:
      select  "client_addr" as '客户端IP',"client_type" as '客户端类型',"server_addr" as '服务端IP',"command_name" as '执行命令',"command_keys" as '命令KEYS',"command_param" as '命令内容',"command_type" as '命令类型',"use_time" as '执行耗时',"time" as '执行时间',"db" as 'DB',"user" as '账号名',"instance_id" as '实例ID',"role" as '节点角色',"extend" as '扩展信息'