# Visualisation don't work even after recreating index templates

**URL:** <https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286>\
**Category:** Kibana\
**Created:** [March 30, 2018, 9:24pm UTC](https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286 "2018-03-30T21:24:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![geertn444](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geertn444/32/31289_2.png) [@geertn444](https://discuss.elastic.co/u/geertn444)\
**Post date:** [March 30, 2018, 9:24pm UTC](https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286/1 "2018-03-30T21:24:12Z")

</div>

Ok, so i got a big problem. I wanted to change some settings in my index template.  
I have a JSON template definition file which i used to import long time ago, before there was any data and dashboards. At that time this index import definition worked.  
It was imported using a command like:

curl -X POST -u USERNAME:PASSWORD [http://KIBANASERVER:5601/api/saved\_objects/index-pattern/elastiflow-\*](http://KIBANASERVER:5601/api/saved_objects/index-pattern/elastiflow-*) -H "Content-Type: application/json" -H "kbn-xsrf: true" -d @/PATH/TO/elastiflow.index\_pattern.json

When i tried to do the same today: i get an error: {"statusCode":400,"error":"Bad Request","message":"child "attributes" fails because ["attributes" is required]. "template" is not allowed. "settings" is not allowed. "mappings" is not allowed. "aliases" is not allowed","validation":{"source":"payload","keys":["attributes","template","settings","mappings","aliases"]}}

It seems you can't change or upload a new index pattern, as long as one exists.

So i removed my index pattern completely in Kibana, hoping that i could then import it again -\> no difference.  
Then i stopped logstash, removed all daily elastiflow-\* indexes in Elasticsearch using Cerebro, so that all references to data were gone.  
Tried to import again -\> no difference (i have no idea how this is possible, what is different when i started with a new installation when it worked ???)

Creating a new index pattern without data seems also to be impossible, so i started logstash again, which luckily imported again data to Elastic. Using this new data, i could recreate the index pattern again with the same name (elastiflow-_), and now my "Discover" etc seems to work again. However, NONE of my Visualisations and Dashboards work anymore !! All fail with the error "can't find index pattern elastiflow-_", however, it is shown when i go to Kibana-\>Index Patterns.

I have no idea how to get my Dashboards working again....  
When i look at a saved object of a simple counter visualisation, i see only a references to the name of the index, so i don't understand why he doesn't find this index:

{  
"index": "elastiflow-_",  
"query": {  
"query": {  
"query\_string": {  
"query": "_",  
"analyze\_wildcard": true  
}  
},  
"language": "lucene"  
},  
"filter": []  
}  
{  
"title": "ElastiFlow: City Count",  
"type": "metric",  
"params": {  
"addLegend": false,  
"addTooltip": true,  
"fontSize": "32",  
"gauge": {  
"autoExtend": false,  
"backStyle": "Full",  
"colorSchema": "Green to Red",  
"colorsRange": [  
{  
"from": 0,  
"to": 100  
}  
],  
"gaugeColorMode": "None",  
"gaugeStyle": "Full",  
"gaugeType": "Metric",  
"invertColors": false,  
"labels": {  
"color": "black",  
"show": true  
},  
"orientation": "vertical",  
"percentageMode": false,  
"scale": {  
"color": "#333",  
"labels": false,  
"show": false,  
"width": 2  
},  
"style": {  
"bgColor": false,  
"bgFill": "#000",  
"fontSize": "36",  
"labelColor": false,  
"subText": ""  
},  
"type": "simple",  
"useRange": false,  
"verticalSplit": false  
},  
"handleNoResults": true,  
"type": "gauge"  
},  
"aggs": [  
{  
"id": "1",  
"enabled": true,  
"type": "cardinality",  
"schema": "metric",  
"params": {  
"field": "flow.geoip.city\_name",  
"customLabel": "Cities"  
}  
}  
],  
"listeners": {}  
}

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [March 30, 2018, 9:31pm UTC](https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286/2 "2018-03-30T21:31:11Z")

</div>

The problem is that the id of the index pattern changed when you recreated it. In the past, the `id` for all saved objects was just their name, so your old `elastiflow-*` pattern had the same ID. Likewise, all the saved objects that referenced it (visualizations and saved searches) used that value for their `index`.

Some time ago, Kibana switched to using UUID strings for the value to allow for saved objects with the same name (mostly to enable multiple index patterns with the same pattern).

Your new index pattern in `elastiflow-*`, but the `id` in Elasticsearch is going to be some UUID value, which you'll have to look up. Once you know that value, you have 2 options:

- Change the `id` of the index pattern to `elastiflow-*`
- Change the `kibanaSavedObjectMeta.searchSourceJSON.index` value in all of your saved visualization objects to match the UUID of the index pattern

---

<div class="post-metadata">

**Author:** ![geertn444](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geertn444/32/31289_2.png) [@geertn444](https://discuss.elastic.co/u/geertn444)\
**Post date:** [March 30, 2018, 9:45pm UTC](https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286/3 "2018-03-30T21:45:30Z")

</div>

ok, so Cerebro shows a UUID string for an index, but i hope it doesn't change per day...

{  
"elastiflow-2018.03.30": {  
"settings": {  
"index": {  
"codec": "best\_compression",  
"refresh\_interval": "5s",  
"number\_of\_shards": "2",  
"provided\_name": "elastiflow-2018.03.30",  
"creation\_date": "1522442205292",  
"number\_of\_replicas": "0",  
"uuid": "ZGSWGSI7RmOAC6spcbC5Vg",  
"version": {  
"created": "6020299"  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![geertn444](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geertn444/32/31289_2.png) [@geertn444](https://discuss.elastic.co/u/geertn444)\
**Post date:** [March 30, 2018, 9:51pm UTC](https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286/4 "2018-03-30T21:51:28Z")

</div>

Ok, so i removed my index pattern again, and recreated it again, now specifying elastiflow-\* as ID under Advanced Options.  
And.... it worked. Thank you very much !!!

The index pattern still creates 1 replica by default, giving 2 unassigned shards each day...i can change the number of replica's on existing indexes, but this whole mess started because i wanted to change it on the pattern, so that it would also count for future generated indexes.......

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [March 30, 2018, 10:58pm UTC](https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286/5 "2018-03-30T22:58:24Z")

</div>

Are you talking about controlling the shards in ES for a given pattern? You can use [index templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html) to do that. Kibana doesn't control any of that though, the index pattern in Kibana is just a way to control how data is pulled from Elasticsearch.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 27, 2018, 10:58pm UTC](https://discuss.elastic.co/t/visualisation-dont-work-even-after-recreating-index-templates/126286/6 "2018-04-27T22:58:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
