From 4b68ce2dade9db59c0cd1f8072c8d163cc2a23cb Mon Sep 17 00:00:00 2001 From: jurgenhaas Date: Mon, 20 Aug 2018 09:18:56 +0200 Subject: [PATCH] Update to version 6.x --- files/ansible.json | 139 ++++++++++++++++++++++++++--- files/haproxy.json | 57 ++++++------ files/uptime.json | 51 +++++++++-- tasks/index.yml | 1 + tasks/install.yml | 2 +- templates/search/ansible.json | 9 +- templates/search/default.json | 10 +-- templates/search/haproxy.json | 5 +- templates/search/matterbridge.json | 23 +++++ templates/search/uptime.json | 26 ++++++ templates/visualize/ansible.json | 8 +- 11 files changed, 264 insertions(+), 67 deletions(-) create mode 100644 templates/search/matterbridge.json create mode 100644 templates/search/uptime.json diff --git a/files/ansible.json b/files/ansible.json index 3c808eb..dee102b 100644 --- a/files/ansible.json +++ b/files/ansible.json @@ -1,42 +1,153 @@ { - "mappings": { + "mapping": { "ansible": { + "_all": { + "enabled": true + }, "properties": { + "@log_name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "@timestamp": { + "type": "date" + }, "ansible_company": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "ansible_host": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "ansible_playbook": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "ansible_result": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "ansible_task": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "ansible_type": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "fluent_added_timestamp": { + "type": "date" }, "host": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "hostname": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "index": { - "type": "integer" + "type": "long" }, "msg": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "session": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "status": { - "type": "string" + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, - "@timestamp": { - "type": "date" + "sys_host": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "sys_module": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "sys_name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } } } } diff --git a/files/haproxy.json b/files/haproxy.json index 9a3f8cb..e3a6a3d 100644 --- a/files/haproxy.json +++ b/files/haproxy.json @@ -1,88 +1,91 @@ { - "mappings": { + "mapping": { "haproxy": { + "_all": { + "enabled": true + }, "properties": { "actconn": { - "type": "string" + "type": "text" }, "b_end": { - "type": "string" + "type": "text" }, "b_server": { - "type": "string" + "type": "text" }, "backend_queue": { - "type": "string" + "type": "text" }, "beconn": { - "type": "string" + "type": "text" }, "bytes_read": { - "type": "string" + "type": "text" }, "c_ip": { - "type": "string" + "type": "text" }, "c_port": { - "type": "string" + "type": "text" }, "captured_request_cookie": { - "type": "string" + "type": "text" }, "captured_response_cookie": { - "type": "string" + "type": "text" }, "f_end": { - "type": "string" + "type": "text" }, "feconn": { - "type": "string" + "type": "text" }, "http_request": { - "type": "string" + "type": "text" }, "pid": { - "type": "string" + "type": "text" }, "prefix": { - "type": "string" + "type": "text" }, "ps": { - "type": "string" + "type": "text" }, "retries": { - "type": "string" + "type": "text" }, "srv_conn": { - "type": "string" + "type": "text" }, "srv_queue": { - "type": "string" + "type": "text" }, "status_code": { - "type": "string" + "type": "text" }, "syslog_time": { "type": "date", "format": "dd/MMM/yyyy:HH:mm:ss Z" }, "tc": { - "type": "string" + "type": "text" }, "termination_state": { - "type": "string" + "type": "text" }, "tq": { - "type": "string" + "type": "text" }, "tr": { - "type": "string" + "type": "text" }, "tt": { - "type": "string" + "type": "text" }, "tw": { - "type": "string" + "type": "text" } } } diff --git a/files/uptime.json b/files/uptime.json index 060a97d..31cb6c9 100644 --- a/files/uptime.json +++ b/files/uptime.json @@ -1,12 +1,39 @@ { - "mappings": { + "mapping": { "ping": { + "_all": { + "enabled": true + }, "properties": { + "@log_name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "@timestamp": { + "type": "date" + }, "downtime": { "type": "integer" }, "error": { - "type": "string" + "type": "text" + }, + "fluent_added_timestamp": { + "type": "date" + }, + "hostname": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, "isResponsive": { "type": "boolean" @@ -15,22 +42,28 @@ "type": "boolean" }, "monitorName": { - "type": "string" + "type": "text" }, "name": { - "type": "string" + "type": "text" }, "responseTime": { "type": "integer" }, - "tags": { - "type": "string" + "tag": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } }, - "@timestamp": { - "type": "date" + "tags": { + "type": "text" }, "url": { - "type": "string" + "type": "text" } } } diff --git a/tasks/index.yml b/tasks/index.yml index 259de8e..cc0343b 100644 --- a/tasks/index.yml +++ b/tasks/index.yml @@ -16,3 +16,4 @@ status_code: 200 body_format: 'json' when: es_index.status != 200 + failed_when: false diff --git a/tasks/install.yml b/tasks/install.yml index d8ffd56..767f9e0 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -8,7 +8,7 @@ - name: "Apt Repository" apt_repository: - repo: 'deb https://artifacts.elastic.co/packages/5.x/apt stable main' + repo: 'deb https://artifacts.elastic.co/packages/6.x/apt stable main' state: 'present' mode: '644' notify: diff --git a/templates/search/ansible.json b/templates/search/ansible.json index 4e59b50..6cf3b33 100644 --- a/templates/search/ansible.json +++ b/templates/search/ansible.json @@ -1,18 +1,17 @@ [ { - "_id": "Ansible", + "_id": "cbdb4ec0-9669-11e8-9f37-b1928f70a11e", "_type": "search", "_source": { "title": "Ansible", "description": "", "hits": 0, "columns": [ - "index", "status", "ansible_company", + "ansible_host", "ansible_playbook", - "ansible_task", - "ansible_host" + "ansible_task" ], "sort": [ "@timestamp", @@ -20,7 +19,7 @@ ], "version": 1, "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"ansible\",\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647},\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}" + "searchSourceJSON": "{\n \"index\": \"24b6eaa0-9669-11e8-9f37-b1928f70a11e\",\n \"highlightAll\": true,\n \"version\": true,\n \"query\": {\n \"language\": \"lucene\",\n \"query\": \"\"\n },\n \"filter\": []\n}" } } } diff --git a/templates/search/default.json b/templates/search/default.json index d7bb8aa..07ab18c 100644 --- a/templates/search/default.json +++ b/templates/search/default.json @@ -1,17 +1,17 @@ [ { - "_id": "Default", + "_id": "811e76f0-9669-11e8-9f37-b1928f70a11e", "_type": "search", "_source": { "title": "Default", "description": "", "hits": 0, "columns": [ - "hostname", - "host", "code", + "host", + "hostname", "message", - "agent" + "path" ], "sort": [ "@timestamp", @@ -19,7 +19,7 @@ ], "version": 1, "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"logstash-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647}}" + "searchSourceJSON": "{\"index\":\"d91446b0-9668-11e8-9f37-b1928f70a11e\",\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[]}" } } } diff --git a/templates/search/haproxy.json b/templates/search/haproxy.json index 1bee0f5..91dd048 100644 --- a/templates/search/haproxy.json +++ b/templates/search/haproxy.json @@ -1,6 +1,7 @@ [ { - "_id": "HaProxy", + { + "_id": "cbdb4ec0-9669-11e8-9f37-b1928f70a11e", "_type": "search", "_source": { "title": "HaProxy", @@ -23,4 +24,4 @@ } } } -] \ No newline at end of file +] diff --git a/templates/search/matterbridge.json b/templates/search/matterbridge.json new file mode 100644 index 0000000..7a482b6 --- /dev/null +++ b/templates/search/matterbridge.json @@ -0,0 +1,23 @@ +[ + { + "_id": "894fd390-966a-11e8-9f37-b1928f70a11e", + "_type": "search", + "_source": { + "title": "Matterbridge", + "description": "", + "hits": 0, + "columns": [ + "level", + "msg" + ], + "sort": [ + "@timestamp", + "desc" + ], + "version": 1, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"index\":\"d91446b0-9668-11e8-9f37-b1928f70a11e\",\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"lucene\",\"query\":\"*\"},\"filter\":[{\"meta\":{\"negate\":false,\"index\":\"d91446b0-9668-11e8-9f37-b1928f70a11e\",\"type\":\"phrase\",\"key\":\"@log_name\",\"value\":\"app.matterbridge\",\"params\":{\"query\":\"app.matterbridge\",\"type\":\"phrase\"},\"disabled\":false,\"alias\":null},\"query\":{\"match\":{\"@log_name\":{\"query\":\"app.matterbridge\",\"type\":\"phrase\"}}},\"$state\":{\"store\":\"appState\"}}]}" + } + } + } +] diff --git a/templates/search/uptime.json b/templates/search/uptime.json new file mode 100644 index 0000000..5b62b71 --- /dev/null +++ b/templates/search/uptime.json @@ -0,0 +1,26 @@ +[ + { + "_id": "1016ce70-966a-11e8-9f37-b1928f70a11e", + "_type": "search", + "_source": { + "title": "Uptime", + "description": "", + "hits": 0, + "columns": [ + "hostname", + "name", + "isUp", + "isResponsive", + "responseTime" + ], + "sort": [ + "@timestamp", + "desc" + ], + "version": 1, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"index\":\"14d18cd0-9669-11e8-9f37-b1928f70a11e\",\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[]}" + } + } + } +] diff --git a/templates/visualize/ansible.json b/templates/visualize/ansible.json index a8c0523..4f528e8 100644 --- a/templates/visualize/ansible.json +++ b/templates/visualize/ansible.json @@ -4,13 +4,13 @@ "_type": "visualization", "_source": { "title": "Ansible", - "visState": "{\"title\":\"Ansible\",\"type\":\"area\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"scale\":\"linear\",\"interpolate\":\"step-after\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"4\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"split\",\"params\":{\"field\":\"ansible_company.keyword\",\"size\":99,\"order\":\"asc\",\"orderBy\":\"_term\",\"customLabel\":\"\",\"row\":true}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{},\"customLabel\":\"Time\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"status.keyword\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"_term\",\"customLabel\":\"Status\"}}],\"listeners\":{}}", - "uiStateJSON": "{\"vis\":{\"colors\":{\"OK\":\"#9AC48A\",\"FAILED\":\"#E24D42\",\"CHANGED\":\"#EAB839\"}}}", + "visState": "{\n \"title\": \"Ansible\",\n \"type\": \"area\",\n \"params\": {\n \"addTooltip\": true,\n \"addLegend\": true,\n \"legendPosition\": \"right\",\n \"scale\": \"linear\",\n \"interpolate\": \"step-after\",\n \"mode\": \"stacked\",\n \"times\": [],\n \"addTimeMarker\": false,\n \"defaultYExtents\": false,\n \"setYExtents\": false\n },\n \"aggs\": [\n {\n \"id\": \"1\",\n \"enabled\": true,\n \"type\": \"count\",\n \"schema\": \"metric\",\n \"params\": {}\n },\n {\n \"id\": \"4\",\n \"enabled\": true,\n \"type\": \"terms\",\n \"schema\": \"split\",\n \"params\": {\n \"field\": \"ansible_company.keyword\",\n \"size\": 99,\n \"order\": \"asc\",\n \"orderBy\": \"_term\",\n \"customLabel\": \"\",\n \"row\": true\n }\n },\n {\n \"id\": \"2\",\n \"enabled\": true,\n \"type\": \"date_histogram\",\n \"schema\": \"segment\",\n \"params\": {\n \"field\": \"@timestamp\",\n \"interval\": \"auto\",\n \"customInterval\": \"2h\",\n \"min_doc_count\": 1,\n \"extended_bounds\": {},\n \"customLabel\": \"Time\"\n }\n },\n {\n \"id\": \"3\",\n \"enabled\": true,\n \"type\": \"terms\",\n \"schema\": \"group\",\n \"params\": {\n \"field\": \"status.keyword\",\n \"size\": 5,\n \"order\": \"desc\",\n \"orderBy\": \"_term\",\n \"customLabel\": \"Status\"\n }\n }\n ],\n \"listeners\": {}\n}", + "uiStateJSON": "{\n \"vis\": {\n \"colors\": {\n \"OK\": \"#9AC48A\",\n \"FAILED\": \"#E24D42\",\n \"CHANGED\": \"#EAB839\"\n }\n }\n}", "description": "", - "savedSearchId": "Ansible", + "savedSearchId": "cbdb4ec0-9669-11e8-9f37-b1928f70a11e", "version": 1, "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"filter\":[]}" + "searchSourceJSON": "{\n \"filter\": []\n}" } } } -- GitLab