grafana_饼图
根据bran字段名称对应value数值 .
SELECT
$__timeGroupAlias(time,$__interval),
bran AS metric,
count(value) AS value
FROM sysbash
WHERE
((name='sysfile' and value>50) or (name='cpu' and value>90) or (name='mem' and value>90)) and time>DATE_SUB(NOW(), INTERVAL 10 MINUTE)
GROUP BY 1,2
ORDER BY $__timeGroup(time,$__interval)
固定名称 , 将所有结果统称一个名字
A :
SELECT
$__timeGroupAlias(time,$__interval),
<series name column> as metric ##
count(value) AS "系统报错"
FROM sysbash
WHERE
((name='sysfile' and value>50) or (name='cpu' and value>90) or (name='mem' and value>90)) and time>DATE_SUB(NOW(), INTERVAL 10 MINUTE)
GROUP BY 1
ORDER BY $__timeGroup(time,$__interval)