Use same dashboard on another index

I have created dashboard with multiple visualisations in it on index name: test_1.

Now i want to use this dashboard on another index name: test_2 which has same fields and same data in fact.

I have downloaded the dashboard ndjson file and uploaded it.. and did inspect on it and changed the index name and in the ndjson file also i have renamed the index name to test_2 but the dashboard is not showing data.

Is this is how i need to apply the same dashboard on another index which is of same format? Kindly suggest.

Your approach is close to what I would recommend. You can use the export and import APIs, as long as you are including all the references to the saved visualizations in the dashboard. You will need to find the indexpattern name and ID for the new index pattern, since we refer to index patterns by both name and ID in a few places.

Thanks for your reply Wylie.

There are few questions:

  1. So there is no console or anthing like that instead of manually editing the dashboard.ndjson file in reference[id] field with the new index id?

  2. Is there any API to get Index ID; I know that we can get the index ID from Index management>index name , and in the url I can get the index ID but this might not be suggestable. Is there any way to get ID?

  1. Right, this is a workaround you can only do via scripting.
  2. The Index Pattern ID is the ID of the saved object: you can find this by running a search request against the .kibana index, something like:
POST .kibana/_search
{
  query: { match_phrase: { type: 'index-pattern' } }
}

Did you mean a piece of code to edit in all the places in ndjson or anything like painless scripting? If painless scripting, can you pls give me some idea.

Thank you

I do not mean painless scripting, I mean the general concept of using the Kibana export/import API to modify dashboards.

I am trying with export dashbaord api in dev_console in this format GET <ip-address>/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c and i am getting { "error" : "no handler found for uri [/<ip-address>/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c&pretty=true] and method [GET]" }

Is the format correct? I'm using v7.6

No, that is not correct. Here is the documentation https://www.elastic.co/guide/en/kibana/current/saved-objects-api-export.html

I'm trying to export my dashbaord using saved objects api, however it is giving me no handler found for uri error.

Here is what i have tried:

GET <vm-ip-address>/api/kibana/dashboards/export?dashboard=b986a390-7a5c-11ea-b521-59fdf02d9ef  

Even I have used this but it did not work POST <kibana host>:<port>/s/<space_id>/api/saved_objects/_export

Error message:
{
"error" : "no handler found for uri [/api/kibana/dashboards/export?dashboard=b986a390-7a5c-11ea-b521-59fdf02d9ef&pretty=true] and method [GET]"
}

I access kibana generally in this format : <vm-ip-address>/app/kibana and http://localhost:5601/app/kibana doesnt work because of the way i have installed.

Are you trying to do this from dev tools? The saved object apis are not available there, you have to use curl or another tool outside of Kibana to access them.

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