# Creating Index/Visualization/Dashboards via REST API V 7.1

**URL:** <https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354>\
**Category:** Kibana\
**Created:** [June 25, 2019, 1:51pm UTC](https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354 "2019-06-25T13:51:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgervais](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@pgervais](https://discuss.elastic.co/u/pgervais)\
**Post date:** [June 25, 2019, 1:51pm UTC](https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354/1 "2019-06-25T13:51:39Z")

</div>

I have created a web based front end to my data set. My front end program extracts the data and inserts it into ELK via logstash. I then want to create a visualization followed by dashboards via saved\_objects REST API.  
When logstash completes, there is an index shown in Elasticsearch Index Management panel. There is no index shown in the Kibana Index Patterns panel. i.e. one must be created manually. This involves selecting the index by name and then assigning a time field (normally @timestamp).

If you do a GET REST operation after logstash completes (either by curl or Postman) you get back:

curl -X GET "[http://localhost:5601/api/saved\_objects/\_find?type=index-pattern&search\_fields=title&search=\*](http://localhost:5601/api/saved_objects/_find?type=index-pattern&search_fields=title&search=*)" -H 'kbn-xsrf: true' -H 'Content-Type: application/json'

returns  
{  
"page": 1,  
"per\_page": 20,  
"total": 0,  
"saved\_objects":   
}

Once you create the index via Kibana Index Pattern manually, you get back the proper JSON.

Question: What is the Kibana REST API that needs to be used to create an kibana index from logstash ? Keep in mind that the only an ID gets created is after the manual kibana process.

If its the Create Object REST API, what JSON attributes needs to be defined.  
Since the index is defined as an Elastiscsearch index, do I use Update Object?  
Again,what JSON attributes needs to be defined?

Keep in mind that the GET returns no information after logstash has ingested the data.

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [June 25, 2019, 9:38pm UTC](https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354/2 "2019-06-25T21:38:59Z")

</div>

If I understand correctly, you want to create an [Index Pattern](https://www.elastic.co/guide/en/kibana/7.2/index-patterns.html) for Kibana. An index pattern can include a wildcard to match multiple index names in Elasticsearch.

[Here is an example from the reference to create an index pattern using the REST API.](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-create.html#_examples_4). In the example, the `my-pattern-*` index pattern in Kibana will match Elasticsearch indexes named `my-pattern-0`, `my-pattern-1`, `my-pattern-2`, etc.

---

<div class="post-metadata">

**Author:** ![pgervais](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@pgervais](https://discuss.elastic.co/u/pgervais)\
**Post date:** [June 26, 2019, 7:33pm UTC](https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354/3 "2019-06-26T19:33:18Z")

</div>

Nick,  
Got the create object for a index-pattern to work.  
Where can I get the JSON Payload format required to Create a Visualization required in the attributes?

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [June 26, 2019, 8:48pm UTC](https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354/4 "2019-06-26T20:48:29Z")

</div>

Hi Peter. I don't think that visualization saved objects JSON schema is documented anywhere. I would recommend creating the visualization(s) you want in Kibana and then [export the saved objects](https://www.elastic.co/guide/en/kibana/current/managing-saved-objects.html#managing-saved-objects-export-objects) to get the schema.

You can also watch the API calls in your browser's developer tools as you save a visualization to see how the payload gets sent.

---

<div class="post-metadata">

**Author:** ![pgervais](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@pgervais](https://discuss.elastic.co/u/pgervais)\
**Post date:** [June 26, 2019, 10:08pm UTC](https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354/5 "2019-06-26T22:08:30Z")

</div>

Which schematic should I use ?

The one returned with GET or the export saved object one ?

They are significantly different ?

Peter Gervais  
25 Fraser Street , PO Box 21

St Andrews West

K0C 2A0

613-938-6549

---

<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:** [July 24, 2019, 10:08pm UTC](https://discuss.elastic.co/t/creating-index-visualization-dashboards-via-rest-api-v-7-1/187354/6 "2019-07-24T22:08:35Z")

</div>

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