LoginSignup
2
2

More than 5 years have passed since last update.

KibanaのダッシュボードをAPI経由でインポート/エクスポートする

Posted at

概要

ansible等でKibanaの設定を一気に済ませたく、API経由でダッシュボードをインポートする方法を調べました。

ローカルとかで検証用に構築したKibanaからダッシュボードの設定ファイルをエクスポートし、そのファイルをansibleで管理してインポートすることで同じ設定のKibanaを自動で構築することができました。

環境

Elasticsearch 6.4.2
Kibana 6.4.2

エクスポート

$ curl -H 'Content-type:application/json' -H 'kbn-xsrf:anything' http://127.0.0.1:5601/api/kibana/dashboards/export?dashboard=xxxx-xxxx-xxxx-xxxx-xxxxxxxxx

クエリパラメータに設定するdashboadのUUIDはKibanaのUIから取得します。

インポート

curl -X POST -H 'Content-type:application/json' -H 'kbn-xsrf:anything'  http://127.0.0.1:5601/api/kibana/dashboards/import -d '{エクスポートしたJSON}'
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2