Kibana[5.6] Using API endpoints to save objects

Kibana version: 5.6
Hi,
My issue is related to the REST API endpoints.
Currently, I am able to save my dashboards using the GUI of Kibana in json format in my local drive.
I wanted to enquire whether it is possible for me to save/create a visualization object by using curl and request like this POST <kibana_url>/api/saved_objects/<type> to save/create my object.

Also I am able to view the JSON output of the following links:

  • https://<host-url>/kibana-monit/api/saved_objects/visualization/Node-DEMO
  • https://<host-url>/kibana-monit/api/saved_objects/

Thank you.

Hey @Vinay_Kumar, while it's technically possible for you to reverse engineer how Visualizations are saved and create/update them using CURL, this isn't supported and will likely break between different versions of Kibana.

Hey thanks a lot, @Brandon_Kobel, Let me extend this discussion little bit.

so currently I've been using the validate API of elasticsearch in order to validate my query.
the URL that I am hitting is as follows:

curl -X GET -H 'Content-Type: application/json' --data @query.json 'http:///_validate/query?explain=true

the file query.json contains the following:
{ "query": { "match_all": {} }, "filter": [ { "meta": { "index": "Node-DEMO", "negate": false, "disabled": false, "alias": null, "type": "exists", "key": "node_stats.indices.docs.count", "value": "exists" }, "exists": { "field": "index_stats.total.query_cache.miss_count" } } ] }

Error that I received: org.elasticsearch.common.ParsingException: request does not support [filter]

Is it possible to validate this query?

This is a completely separate question, I'd recommend a separate topic in the Elasticsearch section for this.

In the new thread you created, you are indicating that you are using Elasticsearch 2.x. Is that correct?

If that is the case, not that this version is not compatible with Kibana 5.6.

Hey @Christian_Dahlqvist,
Sorry for the mistake, I have updated it now.
ES version is 5.x.

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