Beats Dashboards 基础3

2022-02-11 16:27:59 浏览数 (2)

.kibana 已经变大了,之前是 8.3kb 现在是 97.6kb ,原因是导入的数据都装到了这里

load.sh 实际的作为

代码语言:javascript复制
[root@h102 beats-dashboards-1.0.1]# ls
CHANGELOG.md  dashboards  load.sh  Makefile  README.md  release.sh  save  screenshots
[root@h102 beats-dashboards-1.0.1]# wc -l load.sh 
56 load.sh
[root@h102 beats-dashboards-1.0.1]# cat load.sh 
#!/bin/bash

if [ -z "$1" ]; then
    ELASTICSEARCH=http://localhost:9200
else
    ELASTICSEARCH=$1
fi

if [ -z "$2" ]; then
    CURL=curl
else
    CURL="curl --user $2"
fi

echo $CURL
DIR=dashboards

for file in $DIR/search/*.json
do
    name=`basename $file .json`
    echo "Loading search $name:"
    $CURL -XPUT $ELASTICSEARCH/.kibana/search/$name 
        -d @$file || exit 1
    echo
done

for file in $DIR/visualization/*.json
do
    name=`basename $file .json`
    echo "Loading visualization $name:"
    $CURL -XPUT $ELASTICSEARCH/.kibana/visualization/$name 
        -d @$file || exit 1
    echo
done

for file in $DIR/dashboard/*.json
do
    name=`basename $file .json`
    echo "Loading dashboard $name:"
    $CURL -XPUT $ELASTICSEARCH/.kibana/dashboard/$name 
        -d @$file || exit 1
    echo
done

for file in $DIR/index-pattern/*.json
do
    name=`basename $file .json`
    printf -v escape "%q" $name
    echo "Loading index pattern $escape:"

    $CURL -XPUT $ELASTICSEARCH/.kibana/index-pattern/$escape 
        -d @$file || exit 1
    echo
done


[root@h102 beats-dashboards-1.0.1]# 

0 人点赞