diff --git a/elk_metrics_6x/assets/openstack-kibana-custom-dashboard.png b/elk_metrics_6x/assets/openstack-kibana-custom-dashboard.png new file mode 100644 index 00000000..c778db25 Binary files /dev/null and b/elk_metrics_6x/assets/openstack-kibana-custom-dashboard.png differ diff --git a/elk_metrics_6x/readme.rst b/elk_metrics_6x/readme.rst index 33995fda..a137ff8d 100644 --- a/elk_metrics_6x/readme.rst +++ b/elk_metrics_6x/readme.rst @@ -422,6 +422,24 @@ Example command using the embedded Ansible from within the grafana directory. -e galera_root_user=root \ -e 'galera_address={{ internal_lb_vip_address }}' +Optional | add kibana custom dashboard +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you want to use a custom dashboard directly on your kibana, +you can run the playbook bellow. The dashboard uses filebeat to +collect the logs of your deployment. + +.. code-block:: bash + + ansible-playbook setupKibanaDashboard.yml $USER_VARS + +Overview of kibana custom dashboard + +.. image:: assets/openstack-kibana-custom-dashboard.png + :scale: 50 % + :alt: Kibana Custom Dashboard + :align: center + Upgrading the cluster --------------------- diff --git a/elk_metrics_6x/setupKibanaDashboard.yml b/elk_metrics_6x/setupKibanaDashboard.yml new file mode 100644 index 00000000..09b7aea4 --- /dev/null +++ b/elk_metrics_6x/setupKibanaDashboard.yml @@ -0,0 +1,37 @@ +--- +- name: Install Kibana Dashboards + hosts: "elastic-logstash" + become: true + vars_files: + - vars/variables.yml + + environment: "{{ deployment_environment_variables | default({}) }}" + + tasks: + - name: Add nodejs 6.x source + shell: "curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -" + + - name: Install nodejs + apt: + name: nodejs + state: "present" + update_cache: yes + register: _apt_task + until: _apt_task is success + retries: 3 + delay: 2 + + - name: Install elasticdump + npm: + name: elasticdump + path: /opt/elasticdump + state: "present" + + - block: + - name: Copy openstack dashboard json template to /tmp dir + template: + src: templates/openstack-log-dashboard.json + dest: /tmp/openstack-log-dashboard.json + + - name: Upload Custom Openstack Log Dashboard + shell: "/opt/elasticdump/node_modules/elasticdump/bin/elasticdump --input=/tmp/openstack-log-dashboard.json --output={{ kibana_index_on_elasticsearch }} --type=data" diff --git a/elk_metrics_6x/templates/openstack-log-dashboard.json b/elk_metrics_6x/templates/openstack-log-dashboard.json new file mode 100644 index 00000000..b03edc3b --- /dev/null +++ b/elk_metrics_6x/templates/openstack-log-dashboard.json @@ -0,0 +1,107 @@ +{ + "_index":".kibana", + "_type":"doc", + "_id":"visualization:439b9700-78a4-11e8-b957-6d408ad5f3d7", + "_score":1, + "_source":{ + "type":"visualization", + "visualization":{ + "title":"[OpenStack] Log Level", + "visState":"{\"title\":\"[OpenStack] Log Level\",\"type\":\"pie\",\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"\"}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"loglevel\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"customLabel\":\"OpenStack LOG\"}}]}", + "uiStateJSON":"{}", + "description":"", + "version":1, + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"index\":\"filebeat-*\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}" + } + } + } +} +{ + "_index":".kibana", + "_type":"doc", + "_id":"visualization:aee19340-78b6-11e8-b957-6d408ad5f3d7", + "_score":1, + "_source":{ + "type":"visualization", + "updated_at":"2018-06-25T20:31:04.820Z", + "visualization":{ + "title":"[OpenStack] Log Level by Module Name", + "visState":"{\"title\":\"[OpenStack] Log Level by Module Name\",\"type\":\"pie\",\"params\":{\"addLegend\":true,\"addTooltip\":true,\"isDonut\":true,\"labels\":{\"last_level\":true,\"show\":false,\"truncate\":100,\"values\":true},\"legendPosition\":\"right\",\"type\":\"pie\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"module\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}]}", + "uiStateJSON":"{}", + "description":"", + "version":1, + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"index\":\"filebeat-*\",\"filter\":[],\"query\":{\"language\":\"lucene\",\"query\":\"\"}}" + } + } + } +} +{ + "_index":".kibana", + "_type":"doc", + "_id":"visualization:7b6488c0-78b5-11e8-b957-6d408ad5f3d7", + "_score":1, + "_source":{ + "type":"visualization", + "updated_at":"2018-06-25T20:22:28.939Z", + "visualization":{ + "title":"[Openstack] Log Level Bar Per Host", + "visState":"{\"title\":\"[Openstack] Log Level Bar Per Host\",\"type\":\"histogram\",\"params\":{\"type\":\"histogram\",\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100},\"title\":{}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":true,\"mode\":\"stacked\",\"type\":\"histogram\",\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"data\":{\"id\":\"2\",\"label\":\"Count\"},\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false},\"aggs\":[{\"id\":\"2\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"beat.hostname\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":20,\"order\":\"desc\",\"orderBy\":\"2\"}},{\"id\":\"4\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"loglevel\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"2\"}}]}", + "uiStateJSON":"{}", + "description":"", + "version":1, + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"index\":\"filebeat-*\",\"filter\":[],\"query\":{\"language\":\"lucene\",\"query\":\"\"}}" + } + } + } +} +{ + "_index":".kibana", + "_type":"doc", + "_id":"search:51d3fb90-78b9-11e8-b957-6d408ad5f3d7", + "_score":1, + "_source":{ + "type":"search", + "updated_at":"2018-06-25T20:51:10.156Z", + "search":{ + "title":"AllLogs", + "description":"", + "hits":0, + "columns":[ + "_source" + ], + "sort":[ + "@timestamp", + "desc" + ], + "version":1, + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"index\":\"filebeat-*\",\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"lucene\",\"query\":\"*\"},\"filter\":[]}" + } + } + } +} +{ + "_index":".kibana", + "_type":"doc", + "_id":"dashboard:1ffbe820-78b0-11e8-b957-6d408ad5f3d7", + "_score":1, + "_source":{ + "type":"dashboard", + "updated_at":"2018-06-25T20:52:44.699Z", + "dashboard":{ + "title":"[Openstack] Log Dashboard", + "hits":0, + "description":"", + "panelsJSON":"[{\"panelIndex\":\"1\",\"gridData\":{\"x\":0,\"y\":0,\"w\":6,\"h\":3,\"i\":\"1\"},\"id\":\"439b9700-78a4-11e8-b957-6d408ad5f3d7\",\"type\":\"visualization\",\"version\":\"6.2.4\"},{\"panelIndex\":\"2\",\"gridData\":{\"x\":0,\"y\":3,\"w\":12,\"h\":5,\"i\":\"2\"},\"id\":\"7b6488c0-78b5-11e8-b957-6d408ad5f3d7\",\"type\":\"visualization\",\"version\":\"6.2.4\"},{\"panelIndex\":\"3\",\"gridData\":{\"x\":6,\"y\":0,\"w\":6,\"h\":3,\"i\":\"3\"},\"id\":\"aee19340-78b6-11e8-b957-6d408ad5f3d7\",\"type\":\"visualization\",\"version\":\"6.2.4\"},{\"panelIndex\":\"5\",\"gridData\":{\"x\":0,\"y\":8,\"w\":12,\"h\":5,\"i\":\"5\"},\"version\":\"6.2.4\",\"type\":\"search\",\"id\":\"51d3fb90-78b9-11e8-b957-6d408ad5f3d7\"}]", + "optionsJSON":"{\"darkTheme\":false,\"hidePanelTitles\":false,\"useMargins\":true}", + "version":1, + "timeRestore":false, + "kibanaSavedObjectMeta":{ + "searchSourceJSON":"{\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" + } + } + } +} diff --git a/elk_metrics_6x/vars/variables.yml b/elk_metrics_6x/vars/variables.yml index d4dbbac1..e2821010 100644 --- a/elk_metrics_6x/vars/variables.yml +++ b/elk_metrics_6x/vars/variables.yml @@ -35,7 +35,7 @@ kibana_username: admin kibana_password: admin kibana_nginx_port: 81 kibana_server_name: "{{ ansible_hostname }}" - +kibana_index_on_elasticsearch: "http://{{ hostvars[groups['elastic-logstash'][0]]['container_address'] }}:{{ elastic_port}}/.kibana" # logstash vars logstash_beat_input_port: 5044