# Dynamic Dashboard Schema and Dynamic kibana charts

**URL:** https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472
**Category:** Kibana
**Created:** [September 14, 2016, 9:14am UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472 "2016-09-14T09:14:48Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![David\_L](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@David\_L](https://discuss.elastic.co/u/David_L)
#### Post date: [September 14, 2016, 9:14am UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/1 "2016-09-14T09:14:48Z")

</div>

Hi All,  
I trying to find the way to configure/develop kibana Dashboard that change dynamically over time.  
I mean that i stream 100 parameters data into elasticsearch in real time and want to see the top 10 parameters every 5 minutes.

1. How i can show different top 10 parameters in the same chart every 5 minutes?
2. How i can show different top 10 parameters in separate 10 charts every 5 minutes? How to enforce reconfiguring of kibana dashboard DYNAMICALLY ?

Thanks in advance,  
Really appreciate any help  
David,

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [September 14, 2016, 6:39pm UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/2 "2016-09-14T18:39:31Z")

</div>

You can enable the "Auto-Refresh" feature of a Dashboard so that the data is re-fetched at an interval you specify. You can make it every 5 minutes if you like.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/2757ea64e89ef1f2d992c7b91460ac7191938e8b.gif)

---

<div class="post-metadata">

### Author: ![David\_L](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@David\_L](https://discuss.elastic.co/u/David_L)
#### Post date: [September 15, 2016, 3:30pm UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/3 "2016-09-15T15:30:01Z")

</div>

Hi Tim Sullivan,  
Thank you about your response.  
It seems that I found the solution to that problem (but not automatically and safely as i expect -any suggestion are highly welcomed):

1. 

```
  How to Import/Export dashboard as json file manually:

```

You can export saved dashboards, visualizations, and searches from Settings \>\> Objects (see below)  
Remember to export associated visualizations and searches alongside the dashboard...  
just clicking on dashboard export does not automatically include dependent objects.  
2. Kibana under the hood: object persistence:  
Users of Kibana create saved searches, visualizations, dashboards, and other such objects.  
Kibana, of course, has to persist these objects somewhere so they can be loaded up next time users start it up.  
As Kibana connects to Elasticsearch for querying users’ data anyway, it conveniently uses Elasticsearch to store its objects as well.  
This blog post explores some of these objects, how they are stored in Elasticsearch, and when they are created.  
The goal is for this information to serve as a useful tool not only for debugging but also for administrators who might want to deploy Kibana in an automated, repeatable fashion today.  
3. Creating Kibana Dashboard Programmatically:  
You can either write directly to the .kibana index or use the URL structure to create dynamic dashboards (though the latter requires you already have saved visualizations you're combining).  
4. Building Kibana Dashboard Dynamically:  
Look at the .kibana index in your elasticsearch ... it contains all the visualizations , dashboards etc.  
You can use the normal elasticsearch REST Api to modify and add to this index.  
Alternatively , a lot of what drives a dashboard (the different panels and filters) can be changed directly in the url (in RISON format)  
generate the dashboard object with graphs for each new chart and then push it to the .kibana index ,  
which will then update the existing dashboard and everyone who uses it will get the updated dashboard next time they refresh.  
The visualizations are also stored there , so the same concept applies where you would first generate a visualization object  
(tying to extract the data to the specific new chart from ES before )  
to push to .kibana , before you reference it in your dashboard.

---

<div class="post-metadata">

### Author: ![layeghy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/layeghy/32/18902_2.png) [@layeghy](https://discuss.elastic.co/u/layeghy)
#### Post date: [June 13, 2017, 12:51am UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/4 "2017-06-13T00:51:34Z")

</div>

Thanks David  
I had been wandering around for an answer to this question and I could not find this simple solution anywhere.  
It worked for me very nice.

Siamak

---

<div class="post-metadata">

### Author: ![rajisankar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajisankar/32/43250_2.png) [@rajisankar](https://discuss.elastic.co/u/rajisankar)
#### Post date: [September 11, 2017, 1:21am UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/5 "2017-09-11T01:21:11Z")

</div>

Hi,

This is very useful information for creating dashboard and visualizations dynamically.

**Is there a way to dynamically generate the panelsJSON field?**

"panelsJSON": "[{"col":1,"id":"Active-Requests-By-Server","panelIndex":7,"row":9,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":7,"id":"EL1-Cache-Hits-By-Server","panelIndex":8,"row":5,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":1,"id":"L1-Cache-Hits-By-Server","panelIndex":9,"row":5,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":7,"id":"Stream-Count-by-Server","panelIndex":10,"row":1,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":1,"id":"Total-Stream-Count","panelIndex":11,"row":1,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":7,"id":"Queue-Depth-By-Server","panelIndex":12,"row":9,"size\_x":6,"size\_y":4,"type":"visualization"}]"

Currently, the panel should be defined with the row, column [information.So](http://information.So), everytime we need to add/remove a visualization, we need to go through existing list of visualizations in the panelsJSON field and add/remove our visualization. Instead it would be nice if there is a api call for adding visualization to the existing dashboard.

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [September 13, 2017, 10:32pm UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/6 "2017-09-13T22:32:52Z")

</div>

Hi Raji,  
Currently there are no APIs in Kibana for what you are trying to do.

---

<div class="post-metadata">

### Author: ![rajisankar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajisankar/32/43250_2.png) [@rajisankar](https://discuss.elastic.co/u/rajisankar)
#### Post date: [September 13, 2017, 11:23pm UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/7 "2017-09-13T23:23:23Z")

</div>

Thanks, i ended up writing a program to dynamically add/remove visualizations in dashboard.

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [September 14, 2017, 3:59pm UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/8 "2017-09-14T15:59:05Z")

</div>

Nice! That's the recommended way to manage this.

---

<div class="post-metadata">

### Author: ![ashvita](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@ashvita](https://discuss.elastic.co/u/ashvita)
#### Post date: [October 17, 2017, 7:39pm UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/9 "2017-10-17T19:39:08Z")

</div>

Hey,  
Can you please share how did you do this?

---

<div class="post-metadata">

### Author: ![rajisankar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajisankar/32/43250_2.png) [@rajisankar](https://discuss.elastic.co/u/rajisankar)
#### Post date: [October 23, 2017, 4:07pm UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/10 "2017-10-23T16:07:09Z")

</div>

Hey Ashvita,

Sorry for the delayed response. I ended up writing a go program which connects to elasticsearch using the net/http client, creates new visualizations, fetches the existing dashboard, adds the new visualizations to the dashboard and uploads the new dashboard in elasticsearch.

For example, lets say you have a dashboard called Network-Bandwidth and need to add ingress and egress visualizations of your servers in it.

- Fetch all visualizations present  
GET - [http://localhost:9200/.kibana/visualization/\_search](http://localhost:9200/.kibana/visualization/_search)

- Check if the visualizations you need exists, if not, create new ones  
PUT - [http://localhost:9200/.kibana/visualization/Egress%20Bandwidth%20-%20abc](http://localhost:9200/.kibana/visualization/Egress%20Bandwidth%20-%20abc)  
{  
"title": "Egress Bandwidth - abc",  
"visState": "{"title":"Egress Bandwidth - abc","type":"timelion","params":{"expression":".es(index=\"logstash-_\", q=\"system.network.type.keyword:(Egress OR Both)\",metric=\"max:system.network.out.bytes\", split=\"system.network.name.keyword:20\", kibana=true).derivative().multiply(8).scale\_interval(1s).if(operator=\"lt\", if=0, then=0).trim(start=2,end=1).label(regex=\"^._ system.network.name.keyword:(.+) \> ._$\", label=\"$1\").lines(width=2).yaxis(units=bits/s, min=0)","interval":"auto"},"aggs":[],"listeners":{}}",  
"uiStateJSON": "{}",  
"description": "",  
"version": 1,  
"kibanaSavedObjectMeta": {  
"searchSourceJSON": "{"query":{"query\_string":{"query":"_"}},"filter":[]}"  
}  
}

- Fetch the dashboard using the following URL  
GET - [http://localhost:9200/.kibana/dashboard/Network-Bandwidth/\_source](http://localhost:9200/.kibana/dashboard/Network-Bandwidth/_source)

- Re-create the panelsJSON of the dashboard including the new visualization(s)

- Upload the new dashboard using the following  
PUT - [http://localhost:9200/.kibana/dashboard/Network-Bandwidth](http://localhost:9200/.kibana/dashboard/Network-Bandwidth)  
{"title":"Network-Bandwidth","hits":0,"description":"Graph with network bandwidth for nodes","panelsJSON":"[{"col":1,"id":"Egress Bandwidth - abc","panelIndex":2,"row":1,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":7,"id":"Ingress Bandwidth - abc","panelIndex":8,"row":1,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":1,"id":"Egress Bandwidth - test123","panelIndex":7,"row":6,"size\_x":6,"size\_y":4,"type":"visualization"},{"col":7,"id":"Ingress Bandwidth - test123","panelIndex":13,"row":6,"size\_x":6,"size\_y":4,"type":"visualization"}]","optionsJSON":"{"darkTheme":false}","uiStateJSON":"{}","version":1,"timeRestore":true,"timeTo":"now","timeFrom":"now-30m","refreshInterval":{"display":"30 seconds","pause":false,"section":1,"value":30000},"kibanaSavedObjectMeta":{"searchSourceJSON":"{"filter":[{"query":{"query\_string":{"query":"\*"}}}],"highlightAll":true,"version":true}"}}

---

<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: [November 4, 2022, 4:28am UTC](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472/11 "2022-11-04T04:28:14Z")

</div>


