Monday, March 30, 2015

Kibana Quick-Tip: Save those Dashboards!

I like to learn things the hard way, I guess. In an attempt to keep my installation clean, I went to remove the kibana-int index from my system. Why? Because I didn't know what it was, and it had a date from way back when I originally set up my ELK stack on this system. (No, I don't actually read docs. I apparently must always learn by sad experience.  Sigh.) It was easy enough to delete, and I felt good that I had cleaned up some cruft.

Except, now my dashboards are gone. Turns out, Kibana creates its own index, named kibana-int for storing the dashboards and stuff. Oops. 

Did I have a backup of my indices? No - it's just log messages, and the originals are still on their respective systems. We use ELK as a convenience when things are amiss, which rarely happens (except when I go around "cleaning" things!). So I had to spend an hour rebuilding my dashboards. The new one is actually better than the old one, so I suppose that's the optimistic view of the story.

Here's the tip: Export your dashboards to a local file, and keep them under source control, like git.

Then, if you ever need to reload your dashboard after a disaster (or a "cleaning"), you can just load it from a local file in the Open Dashboard menu. Bonus: You can also open a dashboard from a Gist using the same Advanced screen under the Open icon.