更新时间:2024-07-25 GMT+08:00
分享

DSL仪表盘模板

DSL加工是LTS为您提供的一站式日志加工平台,基于领域自定义的脚本语言和200多个内置函数,您可以在LTS控制台实现端到端的日志规整、富化、流转、脱敏、过滤等加工任务。

云日志服务支持DSL(Domain Specific Language)仪表盘模板,DSL加工任务监控中心主要展示加工任务ID、加工任务名称、输入行数、输出行数等信息。

前提条件

DSL加工任务监控中心

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

    • 过滤加工任务ID,所关联的查询分析语句如下所示:
      select distinct(task_id)
    • 过滤加工任务名称,所关联的查询分析语句如下所示:
      select distinct(task_name)
    • 输入行数图表所关联的查询分析语句如下所示:
      SELECT CASE   WHEN  "input" < 1000 THEN concat( cast( "input" AS VARCHAR ), '行' )  WHEN "input" < 1000 * 1000 THEN concat( cast( round( "input"/ 1000, 1 ) AS VARCHAR ), '千行' ) WHEN "input" < 1000000000 THEN concat( cast( round( "input"/ 1000000.0, 1 ) AS VARCHAR ), '百万行' )  WHEN "input"/ 1000.0 < 1000000000 THEN concat( cast( round( "input"/ 1000 / 1000000.0, 1 ) AS VARCHAR ), '十亿行' ) ELSE concat( cast( round( "input"/ 1000.0 / 1000 / 1000 / 1000, 1 ) AS VARCHAR ), '万亿行' )  END AS  "total"  from (select sum("process.accept") as "input")
    • 输出行数图表所关联的查询分析语句如下所示
      SELECT CASE   WHEN  "delivered" < 1000 THEN concat( cast( "delivered" AS VARCHAR ), '行' )  WHEN "delivered" < 1000 * 1000 THEN concat( cast( round( "delivered"/ 1000, 1 ) AS VARCHAR ), '千行' ) WHEN "delivered" < 1000000000 THEN concat( cast( round( "delivered"/ 1000000.0, 1 ) AS VARCHAR ), '百万行' )  WHEN "delivered"/ 1000.0 < 1000000000 THEN concat( cast( round( "delivered"/ 1000 / 1000000.0, 1 ) AS VARCHAR ), '十亿行' ) ELSE concat( cast( round( "delivered"/ 1000.0 / 1000 / 1000 / 1000, 1 ) AS VARCHAR ), '万亿行' )  END AS  "total"  from (select sum("process.delivered") as "delivered")
    • 过滤行数图表所关联的查询分析语句如下所示:
      SELECT CASE   WHEN  "drop" < 1000 THEN concat( cast( "drop" AS VARCHAR ), '行' )  WHEN "drop" < 1000 * 1000 THEN concat( cast( round( "drop"/ 1000, 1 ) AS VARCHAR ), '千行' ) WHEN "drop" < 1000000000 THEN concat( cast( round( "drop"/ 1000000.0, 1 ) AS VARCHAR ), '百万行' )  WHEN "drop"/ 1000.0 < 1000000000 THEN concat( cast( round( "drop"/ 1000 / 1000000.0, 1 ) AS VARCHAR ), '十亿行' ) ELSE concat( cast( round( "drop"/ 1000.0 / 1000 / 1000 / 1000, 1 ) AS VARCHAR ), '万亿行' )  END AS  "total"  from (select sum("process.drop") as "drop")
    • 失败行数图表所关联的查询分析语句如下所示:
      SELECT CASE   WHEN  "failed" < 1000 THEN concat( cast( "failed" AS VARCHAR ), '行' )  WHEN "failed" < 1000 * 1000 THEN concat( cast( round( "failed"/ 1000, 1 ) AS VARCHAR ), '千行' ) WHEN "failed" < 1000000000 THEN concat( cast( round( "failed"/ 1000000.0, 1 ) AS VARCHAR ), '百万行' )  WHEN "failed"/ 1000.0 < 1000000000 THEN concat( cast( round( "failed"/ 1000 / 1000000.0, 1 ) AS VARCHAR ), '十亿行' ) ELSE concat( cast( round( "failed"/ 1000.0 / 1000 / 1000 / 1000, 1 ) AS VARCHAR ), '万亿行' )  END AS  "total"  from (select sum("process.failed") as "failed")
    • 执行记录图表所关联的查询分析语句如下所示:
      select TIME_FORMAT( MILLIS_TO_TIMESTAMP("start"), 'yyyy-MM-dd HH:mm:ss:SSS', '+08:00') as "统计开始时间",TIME_FORMAT( MILLIS_TO_TIMESTAMP("end"), 'yyyy-MM-dd HH:mm:ss:SSS', '+08:00') as "统计结束时间", "process.accept" as "输入行数", "process.delivered" as "输出行数", "process.drop" as "过滤行数", "process.failed" as "失败行数" limit 1000

相关文档