Set static IDs to kibana index templates

Enable user to override templates from recalss-system

Change-Id: Idbd79e7a2cb3826df5a302b917feef1709462254
PROD-related: PROD-22138
diff --git a/kibana/client/init.sls b/kibana/client/init.sls
index 7f0f91c..675ddb9 100644
--- a/kibana/client/init.sls
+++ b/kibana/client/init.sls
@@ -1,8 +1,9 @@
 {%- from "kibana/map.jinja" import client with context %}
 {%- if client.get('enabled', False) %}
 
-{%- set kibana_version = salt['pkg.version']('kibana') %}
-{%- if kibana_version is defined %}
+  {%- set kibana_version = salt['pkg.version']('kibana') %}
+
+  {%- if kibana_version is defined %}
 kibana_object_config:
   kibana_object.present:
   - kibana_content:
@@ -10,23 +11,28 @@
   - name: {{ kibana_version }}
   - kibana_type: 'config'
 
-{%- for object_name, object in client.get('object', {}).iteritems() %}
+  {%- for object_name, object in client.get('object', {}).iteritems() %}
+    {%- if object.get('enabled', False) %}
+      {%- set pillar_content = object.get("content", {}) %}
+      {%- if object.template is defined %}
+        {%- import_json object.template as content %}
+      {%- else %}
+        {%- set content = {} %}
+      {%- endif %}
+      {%- do salt['defaults.merge'](content, pillar_content) %}
 kibana_object_{{ object_name }}:
-  {%- if object.get('enabled', False) %}
-  {%- if object.content is defined %}
   kibana_object.present:
-  - kibana_content: {{ object.content|json }}
-  {%- else %}
-  {% import_json object.template as content %}
-  kibana_object.present:
-  - kibana_content: {{ content|json }}
-  {%- endif %}
-  {%- else %}
-  kibana_object.absent:
-  {%- endif %}
-  - name: {{ object.id|default(object_name) }}
+  - kibana_content: {{ content | json }}
+  - name: {{ object.id | default(object_name) }}
   - kibana_type: {{ object.type }}
-{%- endfor %}
+    {%- else %}
 
-{%- endif %}
+kibana_object_{{ object_name }}:
+  kibana_object.absent:
+  - name: {{ object.id | default(object_name) }}
+  - kibana_type: {{ object.type }}
+    {%- endif %}
+
+  {%- endfor %}
+  {%- endif %}
 {%- endif %}
diff --git a/kibana/files/objects/index-pattern_logs.json b/kibana/files/objects/index-pattern_logs.json
index c5077d3..9abefb7 100644
--- a/kibana/files/objects/index-pattern_logs.json
+++ b/kibana/files/objects/index-pattern_logs.json
@@ -1 +1,5 @@
-{"title" : "log-*","timeFieldName" : "Timestamp","fields" :"[{\"name\":\"tenant_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"python_module\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"user_agent_os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"http_response_time\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"programname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Logger\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"openstack_region\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"environment_label\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"user_agent_version\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_method\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_client_ip_address\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"http_response_size\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"deployment_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"remote_addr\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"Hostname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_version\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Severity\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Pid\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"openstack_release\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"syslogfacility\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"instance_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"openstack_roles\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"user_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"user_agent_browser\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"http_status\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Payload\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"request_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"severity_label\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false}]"}
+{
+    "title" : "log-*",
+    "timeFieldName" : "Timestamp",
+    "fields" :"[{\"name\":\"tenant_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"python_module\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"user_agent_os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"http_response_time\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"programname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Logger\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"openstack_region\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"environment_label\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"user_agent_version\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_method\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_client_ip_address\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"http_response_size\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"deployment_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"remote_addr\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"Hostname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_version\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Severity\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Pid\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"openstack_release\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"syslogfacility\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"instance_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"openstack_roles\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"user_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"http_referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"user_agent_browser\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"http_status\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"Payload\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"request_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"severity_label\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false}]"
+}
diff --git a/kibana/files/objects/search_audit.json b/kibana/files/objects/search_audit.json
index d89744b..1da7f62 100644
--- a/kibana/files/objects/search_audit.json
+++ b/kibana/files/objects/search_audit.json
@@ -14,6 +14,6 @@
     ],
     "version": 1,
     "kibanaSavedObjectMeta": {
-        "searchSourceJSON": "{\"index\":\"audit-*\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647}}"
+        "searchSourceJSON": "{\"index\":\"index-template-audit\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647}}"
     }
 }
diff --git a/kibana/files/objects/search_logs.json b/kibana/files/objects/search_logs.json
index 3da81d2..0f2b343 100644
--- a/kibana/files/objects/search_logs.json
+++ b/kibana/files/objects/search_logs.json
@@ -16,6 +16,6 @@
   ],
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\"index\":\"log-*\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647}}"
+    "searchSourceJSON": "{\"index\":\"index-template-log\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647}}"
   }
 }
diff --git a/kibana/files/objects/search_notifications.json b/kibana/files/objects/search_notifications.json
index 47e9b87..3df5aee 100644
--- a/kibana/files/objects/search_notifications.json
+++ b/kibana/files/objects/search_notifications.json
@@ -20,6 +20,6 @@
   ],
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\"index\":\"notification-*\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647}}"
+    "searchSourceJSON": "{\"index\":\"index-template-notification\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647}}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_EVENT-TYPE-BREAKDOWN.json b/kibana/files/objects/v5/visualization_EVENT-TYPE-BREAKDOWN.json
index 9e6744b..763985d 100644
--- a/kibana/files/objects/v5/visualization_EVENT-TYPE-BREAKDOWN.json
+++ b/kibana/files/objects/v5/visualization_EVENT-TYPE-BREAKDOWN.json
@@ -5,6 +5,6 @@
  "description": "",
  "version": 1,
  "kibanaSavedObjectMeta": {
-   "searchSourceJSON": "{\"index\":\"notification-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
+   "searchSourceJSON": "{\"index\":\"index-template-notification\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
  }
 }
diff --git a/kibana/files/objects/v5/visualization_HOST-BREAKDOWN.json b/kibana/files/objects/v5/visualization_HOST-BREAKDOWN.json
index 354778e..4eda142 100644
--- a/kibana/files/objects/v5/visualization_HOST-BREAKDOWN.json
+++ b/kibana/files/objects/v5/visualization_HOST-BREAKDOWN.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\"index\":\"notification-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
+    "searchSourceJSON": "{\"index\":\"index-template-notification\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SEVERITY.json b/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SEVERITY.json
index 2c479ff..4e0db27 100644
--- a/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SEVERITY.json
+++ b/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SEVERITY.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\n  \"index\": \"log-*\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
+    "searchSourceJSON": "{\n  \"index\": \"index-template-log\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SOURCE.json b/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SOURCE.json
index fe162b6..31b6f4f 100644
--- a/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SOURCE.json
+++ b/kibana/files/objects/v5/visualization_LOG-MESSAGES-OVER-TIME-PER-SOURCE.json
@@ -5,6 +5,6 @@
  "description": "",
  "version": 1,
  "kibanaSavedObjectMeta": {
-   "searchSourceJSON": "{\n  \"index\": \"log-*\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
+   "searchSourceJSON": "{\n  \"index\": \"index-template-log\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
  }
 }
diff --git a/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SEVERITY.json b/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SEVERITY.json
index 609b56b..7d35054 100644
--- a/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SEVERITY.json
+++ b/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SEVERITY.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\"index\":\"notification-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
+    "searchSourceJSON": "{\"index\":\"index-template-notification\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SOURCE.json b/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SOURCE.json
index 5fcd6fc..b248023 100644
--- a/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SOURCE.json
+++ b/kibana/files/objects/v5/visualization_NOTIFICATIONS-OVER-TIME-PER-SOURCE.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\n  \"index\": \"notification-*\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
+    "searchSourceJSON": "{\n  \"index\": \"index-template-notification\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_NOTIFICATIONS-PER-SEVERITY.json b/kibana/files/objects/v5/visualization_NOTIFICATIONS-PER-SEVERITY.json
index 9366b51..0112fff 100644
--- a/kibana/files/objects/v5/visualization_NOTIFICATIONS-PER-SEVERITY.json
+++ b/kibana/files/objects/v5/visualization_NOTIFICATIONS-PER-SEVERITY.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\n  \"index\": \"notification-*\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
+    "searchSourceJSON": "{\n  \"index\": \"index-template-notification\",\n  \"query\": {\n    \"query_string\": {\n      \"query\": \"*\",\n      \"analyze_wildcard\": true\n    }\n  },\n  \"filter\": []\n}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_NUMBER-OF-LOG-MESSAGES-PER-SEVERITY.json b/kibana/files/objects/v5/visualization_NUMBER-OF-LOG-MESSAGES-PER-SEVERITY.json
index be7f22f..7d35704 100644
--- a/kibana/files/objects/v5/visualization_NUMBER-OF-LOG-MESSAGES-PER-SEVERITY.json
+++ b/kibana/files/objects/v5/visualization_NUMBER-OF-LOG-MESSAGES-PER-SEVERITY.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\"index\":\"log-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
+    "searchSourceJSON": "{\"index\":\"index-template-log\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_SOURCE-BREAKDOWN.json b/kibana/files/objects/v5/visualization_SOURCE-BREAKDOWN.json
index d4f37cf..a744f89 100644
--- a/kibana/files/objects/v5/visualization_SOURCE-BREAKDOWN.json
+++ b/kibana/files/objects/v5/visualization_SOURCE-BREAKDOWN.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\"index\":\"notification-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
+    "searchSourceJSON": "{\"index\":\"index-template-notification\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_TOP-10-HOSTS.json b/kibana/files/objects/v5/visualization_TOP-10-HOSTS.json
index 417b4e9..4564ad1 100644
--- a/kibana/files/objects/v5/visualization_TOP-10-HOSTS.json
+++ b/kibana/files/objects/v5/visualization_TOP-10-HOSTS.json
@@ -5,6 +5,6 @@
   "description": "",
   "version": 1,
   "kibanaSavedObjectMeta": {
-    "searchSourceJSON": "{\n  \"index\": \"log-*\",\n  \"query\": {\n    \"query_string\": {\n      \"analyze_wildcard\": true,\n      \"query\": \"*\"\n    }\n  },\n  \"filter\": []\n}"
+    "searchSourceJSON": "{\n  \"index\": \"index-template-log\",\n  \"query\": {\n    \"query_string\": {\n      \"analyze_wildcard\": true,\n      \"query\": \"*\"\n    }\n  },\n  \"filter\": []\n}"
   }
 }
diff --git a/kibana/files/objects/v5/visualization_TOP-10-PROGRAMS.json b/kibana/files/objects/v5/visualization_TOP-10-PROGRAMS.json
index a5850d1..d8a6a88 100644
--- a/kibana/files/objects/v5/visualization_TOP-10-PROGRAMS.json
+++ b/kibana/files/objects/v5/visualization_TOP-10-PROGRAMS.json
@@ -5,6 +5,6 @@
  "description": "",
  "version": 1,
  "kibanaSavedObjectMeta": {
-   "searchSourceJSON": "{\n  \"index\": \"log-*\",\n  \"query\": {\n    \"query_string\": {\n      \"analyze_wildcard\": true,\n      \"query\": \"*\"\n    }\n  },\n  \"filter\": []\n}"
+   "searchSourceJSON": "{\n  \"index\": \"index-template-log\",\n  \"query\": {\n    \"query_string\": {\n      \"analyze_wildcard\": true,\n      \"query\": \"*\"\n    }\n  },\n  \"filter\": []\n}"
  }
 }
diff --git a/kibana/files/objects/v5/visualization_TOP-10-SOURCES.json b/kibana/files/objects/v5/visualization_TOP-10-SOURCES.json
index 00b23e5..02438ae 100644
--- a/kibana/files/objects/v5/visualization_TOP-10-SOURCES.json
+++ b/kibana/files/objects/v5/visualization_TOP-10-SOURCES.json
@@ -5,6 +5,6 @@
  "description": "",
  "version": 1,
  "kibanaSavedObjectMeta": {
-   "searchSourceJSON": "{\"index\":\"log-*\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[]}"
+   "searchSourceJSON": "{\"index\":\"index-template-log\",\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}},\"filter\":[]}"
  }
 }
diff --git a/kibana/map.jinja b/kibana/map.jinja
index 5749c15..b19e6be 100644
--- a/kibana/map.jinja
+++ b/kibana/map.jinja
@@ -6,6 +6,7 @@
   default_app_id: discover
 default:
   version: 5
+  cross_cluster_search: true
 {%- endload %}
 
 {% set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('kibana:server'), base='default') %}
diff --git a/metadata/service/client.yml b/metadata/service/client.yml
index 17a1376..cc1e5e1 100644
--- a/metadata/service/client.yml
+++ b/metadata/service/client.yml
@@ -2,7 +2,7 @@
 - kibana
 parameters:
   _param:
-    kibana_client_default_index: "log-*"
+    kibana_client_default_index: index-template-log
     kibana_version: 5
   kibana:
     client:
@@ -17,15 +17,15 @@
           enabled: true
           template: kibana/files/objects/dashboard_notifications.json
           type: dashboard
-        'log-*':
+        index-template-log:
           enabled: true
           template: kibana/files/objects/index-pattern_logs.json
           type: index-pattern
-        'notification-*':
+        index-template-notification:
           enabled: true
           template: kibana/files/objects/index-pattern_notifications.json
           type: index-pattern
-        'audit-*':
+        index-template-audit:
           enabled: true
           template: kibana/files/objects/index-pattern_audit.json
           type: index-pattern
diff --git a/metadata/service/remote_cluster.yml b/metadata/service/remote_cluster.yml
new file mode 100644
index 0000000..510f5dd
--- /dev/null
+++ b/metadata/service/remote_cluster.yml
@@ -0,0 +1,16 @@
+parameters:
+  kibana:
+    client:
+      object:
+        index-template-log:
+          content:
+            title: "*:log-*"
+            notExpandable: true
+        index-template-notification:
+          content:
+            title: "*:notification-*"
+            notExpandable: true
+        index-template-audit:
+          content:
+            title: "*:audit-*"
+            notExpandable: true