I exported Kibana dashboard with cURL command:
curl -XGET localhost:5601/api/kibana/dashboards/export?dashboard=[uuid] > my-dashboards.json
Now I want to import this dashboard using docker-compose, but I get this error:
test.kibana | Warning: Couldn't read data from file "my-dashboards.json", this makes an
test.kibana | Warning: empty POST.
test.kibana | % Total % Received % Xferd Average Speed Time Time Time Current
test.kibana | Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed connect to 0.0.0.0:5601; Connection refused
This is docker-compose file:
version: '2'
services:
elasticsearch-docker:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
container_name: test.elastic
ports:
- 9200:9200
- 9300:9300
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
environment:
- discovery.type=single-node
- xpack.security.enabled=false
kibana:
image: docker.elastic.co/kibana/kibana:5.6.3
container_name: test.kibana
command: curl -XPOST test.elastic:5601/api/kibana/dashboards/import -H 'kbn-xsrf:true' -H 'Content-type:application/json' -d @my-dashboards.json
ports:
- 5601:5601
depends_on:
- elasticsearch-docker
volumes:
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
- ./my-dashboards.json:/usr/share/kibana/config/my-dashboards.json