SHELL

SHELL

# 下载kibana6.2.2 镜像
docker pull docker.elastic.co/kibana/kibana:6.2.2

# 高亮
tail -f xls2csv.sh |perl -pe 's/(csv)/e[1;31m$1e[0m/g'

# grep 零宽断言
echo $x | ggrep -P  "(?<=<id>)d+(?=</id>)"
# 统计bug,并根据计数排序
# $NF最后一列为创建时间 $NF-1为处理人
awk -F ","  '/^(1|2|3)/{++time[$NF]} END {for(i in time)  print time[i],"	",i}'  bugs.csv | sort -t " " -k 2


## 查看 uat分支有提交 但是在测试上没有提交的内容
## grep -- 解决 grep: invalid option -- > 报错
## grep -Ri '->someFunction' 重现
for i in `git log  --oneline |sed  -E 's/^.{9}//g' | sed -e 's/^s+//'`
do
if [[ `glol  release/dice | grep -- "$i" | wc -l` -eq 0 ]]; then
glol  | grep -- "$i"
fi
done

# 查找测试es地址
kubectl get pod --all-namespaces -o wide | grep 'elasticsearch'

kubectl get pod terminus-elasticsearch-1 -n addon-elasticsearch--c812dbe51b02b47eaa2cea5e2ed7e8acb  -o yaml | grep 'value: mobil-es-test'

# 启动es kibana
docker run -d -it  -e ELASTICSEARCH_URL="http://9.166.228.212:9200" -p 5601:5601 --name es_test2 006eb7921543
## spark查询

[root@node-010005241032 ~]# kubectl get pod --all-namespaces -o wide | grep -i 'spark'

统计天数

#/bin/bash
file=$1
path=`echo $file |sed -E 's#(.*)/(.*)#1#'`
filename=`echo $file | sed -E 's#(.*)/(.*)#2#'`

if [ -z $file ]; then
    echo "should input csv file path"
    exit 1
fi
result=""
for i in `grep -E '^(d)' $file | sed -E 's/( )+//g'`
do
    # echo "$i"
    id=`echo $i | cut -d "," -f 1`
    etime=`echo $i | awk -F "," '{print $(NF-2)}'`
    stime=`echo $i | awk -F "," '{print $NF}'`
    if [[ -z `echo $etime | grep -E '^(d)'` ]]; then
        continue
    fi
    # echo "id = $id"
    # echo "stime = $stime"
    # echo "etime = $etime"

    # s_y
    # s_m
    # s_d

    time_s=`date -j -f "%Y-%m-%d" "$stime" "+%s"`
    time_e=`date -j -f "%Y-%m-%d" "$etime" "+%s"`

    # if [ "180315"="$id" ]; then
    #     echo "id = $id"
    #     echo "stime = $stime"
    #     echo "etime = $etime"
    #     break
    # fi

    use=$((($time_e-$time_s)/60/60/24))
    result="$result
$id	$use"
    # echo "$id, $use"
    # time_s=""
    # time_e=""
done
echo $result > $path/tmp
grep -E '^(d)' $path/tmp > $path/tmp2
awk -F "	" 'BEGIN {t0="<3";t3=">=3";t5=">=5";t10=">=10"} {if($2<3){s[t0]++} else if($2<5){s[t3]++}else if($2<10){s[t5]++}else s[t10]++} END {for (i in s) print i,"	",s[i]} ' $path/tmp2
原文地址:https://www.cnblogs.com/blogabc/p/12766491.html