1

I am giving my developers the gift of kibana using the elasticsearch that is bundled with logstash. They will have kibana in their vagrant boxes.

Goal: Install and configure kibana dashboards via scripts on startup.

Problem: How to pre-load exported dashboards into elasticsearch embedded in logstash?

I have downloaded the dashboards, let's call the file: "fancy.json". Once logstash is up and running how can I automate loading fancy.json into elasticsearch?

Dan Garthwaite
  • 2,922
  • 18
  • 29
  • What do you mean by `kibana using the elasticsearch embedded in logstash`? Kibana, Logstash and Elastic are all very different products and as far as I know don't come "bundled". – GregL Sep 30 '15 at 11:06
  • Elasticsearch is bundled into logstash. I like to give context with my questions. The issue is how to pre-load the previously exported dashboards at provision time. – Dan Garthwaite Sep 30 '15 at 11:47
  • Again, I don't think the two products come bundled together. There's an ES output for LS, is that what you mean? – GregL Sep 30 '15 at 12:18
  • Really, it has always been bundled. https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-embedded – Dan Garthwaite Sep 30 '15 at 13:19
  • Well would you look at that! If you have your json file with the dashboard, why can't you just load it into the `.kibana` index with a shell script? – GregL Sep 30 '15 at 13:40
  • That is pretty much the question - with a twist for how to wait for es to come up, which I consider a separate issue. – Dan Garthwaite Sep 30 '15 at 13:41
  • The method will really depend on the platform. `ExecStartPost` would work Linux's using systemd, with an init-script for those that aren't, while a Windows service that depends on the LS service would work on Windows. Either way, the script would have to run `wget` or `curl` requests (using PowerShell on Windows) to check that ES is up before POSTing the dashboards. – GregL Sep 30 '15 at 13:46
  • Can anyone provide an example of how to post any dashboard via curl? I suppose I should create another question for that. – Dan Garthwaite Sep 30 '15 at 15:03
  • 2
    Elastic has posted just that for importing the Beats dashboards: https://github.com/elastic/beats-dashboards, in particular the `load.sh` script. – GregL Sep 30 '15 at 15:05
  • Huzzah! `curl -XPUT localhost:9200/.kibana/dashboard/$dashbord_name -d @$exported_json_file` – Dan Garthwaite Sep 30 '15 at 15:12
  • Yeah, but you need to load all the elements that the dashboard depends on (Visualizations, Searches and Index Patterns). – GregL Sep 30 '15 at 15:13
  • Kibana 3 - until Kibana 4 works with firefox it is right out. – Dan Garthwaite Sep 30 '15 at 15:14

1 Answers1

0

I never figured this out.

Instead I now copy the exported dashboard into /opt/kibana/app/dashboards/company.json and set the default dashboard in /opt/kibana/config.js to point to it.

Dan Garthwaite
  • 2,922
  • 18
  • 29