forked from Ingensi/beats-dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload.sh
executable file
·56 lines (46 loc) · 1.05 KB
/
load.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/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