# 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:** 1\
**Showing post:** 10

<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}"}}

---

_[View the full topic](https://discuss.elastic.co/t/dynamic-dashboard-schema-and-dynamic-kibana-charts/60472)._
