Can I copy a dashboard and its associated visulizations?

This is a feature ('Clone') in their Premium X-Pack but not in standard Kibana as of now.

That's not true. The clone operations is part of Kibana. It's just new, and does the same thing as the "Save as new dashboard".

As Helix pointed out, you can "Save as new dashboard", and that will create a copy of the dashboard, but as you note, it will not create a copy of the underlying visualizations. You'd have to also make copies of all of those, and use those cloned visualizations on your cloned dashboard.

You can do this through the UI, but it's a lot of work. Since everything is just a document in Elasticsearch, it would be much easier to script this.

  • Read the dashboard (a GET operation by ID)
  • Read the visualizations on it (an MGET here)
  • Make a new copy of the visualizations, setting a new ID (the ID can be anything, Kibana just uses a UUID by default, you can do the same)
  • Make a new copy of the dashboard as above, and also change the IDs of the visualizations in it to the copies you just created

This could also be built into a plugin in Kibana if you wanted to do it that way. That would allow you to keep a single interface for managing this stuff, instead of copying a dashboard ID into an external script. You could even create a new control at the top of dashboards that would do all of this right from there.

Since it was pointed out that the Clone operation already exists in Kibana, I think it's reasonable to make a feature request there that would clone the visualizations automatically too. The operation is the same whether Kibana does it or you write your own script to do it.

1 Like