#!/bin/bash
#********************************************************#
##author: 1
##create time: 2024-03-21 11:02:26
#********************************************************#
#set -x
starrocks_conn="mysql -hxxx -Pxxx -uxxx -pxxx -Dxxx -A"
res_text="/home/logsget/test_ly.txt"
today=${system.task.day}
flag=0
${starrocks_conn} -e "
select '天粒度-会员中心转化',count(1) from rpt_aivip_promotionfunnel_dashboard_di where day_id=${today}
union all
select '天粒度-产品图片URL曝光',count(1) from rpt_aivip_promotionpicture_dashboard_di where day_id=${today}
" > $res_text
#echo `cat $res_text`
while read line ;
do
name=`echo $line | awk '{OFS='\t';print $(1)}'`
value=`echo $line | awk '{OFS='\t';print $(2)}'`
if [ ${value} == "0" ];then
echo $name $value
flag=`expr $flag + 1`
fi
#echo 'flag:'$flag
done < $res_text
res=`echo $flag`
echo 'res:'$res
if [ $res -gt 0 ];then
#echo $name $value
exit 1
fi
shell监控数据表行数是否为0
最新推荐文章于 2024-07-08 14:59:34 发布