Get the "request" that a dashboard or a visualization have

Hey, is there anyway to get the request that a dashboard or a visualization uses to get the data programmatically?
Or is there any api that I can use to get the data of a dashboard?
thanks

Hi @aza-zil ,

Let's start with visualization: depending on type, Kibana has different end-points for this purpose.
If you open DevTools Network tab in Chrome you can compare TSVB vs Tag Cloud/Data Table/etc and see the difference. Usually you will be able to find ES request in body of the following requests:
/api/metrics/vis/data and /internal/bsearch.

Since dashboard combines multiple visualisations, you can expect it to have multiple requests for different types of visualisations. There is no single end-point to get all the data by dashboardId.
First you can use saved objects API to get a list of panels by dashboardId like:

POST /api/saved_objects/_bulk_get
    {
        "id": "722b74f0-b882-11e8-a6d9-e546fe2bba5f",
        "type": "dashboard"
    }

Then you can repeat requests that you saw on individual visualisations, Kibana by itself is making some optimisation for dashboards to request data in batch. You can check it by tracking the same Network tab and loading a dashboard:

So there is no easy solution, it depends on what you want to achieve. If you are interested in just data stored in ES, you may try to use ES Search API

Regards, Dima

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