f74c4e0e93903c5cd49546e2a062cb3030673788
[clamp.git] / extra / docker / elk / README.md
1 CLAMP Dashboard
2 ===============
3
4 ELK stack for CLAMP : Logstash is used to retrieve events and notifications from DMaaP and pushes them into Elasticsearch.
5 Kibana is then used to extract statistics.
6
7
8 Deployment instructions
9 -----------------------
10
11 Requirements: docker-compose
12
13 1. Update configuration in docker-compose file
14 2. `docker-compose up -d elasticsearch logstash kibana`
15
16 If you encounter connection problems with kibana, first deploy elasticsearch, wait for it to be available, then kibana.
17
18 Backup/restore
19 --------------
20
21 backup.py and restore.py scripts are available inside the kibana docker image for saving and restoring the configuration.
22
23 ### backup.py 
24 ```
25 docker-compose exec kibana backup.py -C /saved-objects/
26 ```
27 ```
28 usage: backup.py [-h] [-v] [-C CONFIGURATION_PATH] [-f] [-H KIBANA_HOST]
29
30 Description of the script
31
32 optional arguments:
33   -h, --help            show this help message and exit
34   -v, --verbose         Use verbose logging
35   -C CONFIGURATION_PATH, --configuration_path CONFIGURATION_PATH
36                         Path of the configuration to be backed up.
37   -f, --force           If the save folder already exists, overwrite files
38                         matching a configuration item that should be written.
39                         Files already in the folder that do not match are left
40                         as-is.
41   -H KIBANA_HOST, --kibana-host KIBANA_HOST
42                         Kibana endpoint.
43
44 ```
45
46 ### restore.py
47 ```
48 docker-compose exec kibana restore.py -C /saved-objects/ -f
49 ```
50 ```
51 usage: restore.py [-h] [-v] [-C CONFIGURATION_PATH] [-H KIBANA_HOST] [-f]
52
53 Restores the kibana configuration.
54
55 optional arguments:
56   -h, --help            show this help message and exit
57   -v, --verbose         Use verbose logging
58   -C CONFIGURATION_PATH, --configuration_path CONFIGURATION_PATH
59                         Path of the configuration to be restored.Should
60                         contain at least one folder named index-
61                         pattern,config,search,visualization or dashboard
62   -H KIBANA_HOST, --kibana-host KIBANA_HOST
63                         Kibana endpoint.
64   -f, --force           Overwrite configuration if needed.
65 ```
66
67 Tools
68 -----
69
70 The following tools are available in the 'tools/' folder.
71
72
73 ### EsAutoQuery
74
75 Small script ease Elasticsearch /painless/ field development.
76 It reads a json file as a query for Elasticsearch, pushes it on the ES server, and display back the answer in a loop, each time the file is modified.
77
78
79 ### DMaaP Service Mocker
80
81 Script that simulates control loop DMaaP services to provide sample data to logstash through DMaaP.
82
83 TODO
84 ----
85 * Add a script that verifies that elasticsearch is available before starting loading the default configuration for kibana