From 13a9c66c9978b2e6ae6c56c35c0ed1ca93c6c6a9 Mon Sep 17 00:00:00 2001 From: Antoine Cotten Date: Tue, 2 Jan 2018 20:54:40 +0100 Subject: [PATCH] Create index pattern via Kibana API Closes #216 --- .travis.yml | 2 +- README.md | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7e1543..ffeeaf1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,4 +31,4 @@ script: - sleep 30 - docker-compose logs - curl --retry 10 --retry-delay 5 -D- http://localhost:9200/ - - curl --retry 10 --retry-delay 5 -I http://localhost:5601/ + - curl --retry 10 --retry-delay 5 -D- http://localhost:5601/api/status diff --git a/README.md b/README.md index 574a7bd..7858425 100644 --- a/README.md +++ b/README.md @@ -115,15 +115,16 @@ about the index pattern configuration. #### On the command line -Run this command to create a Kibana index pattern: +Create an index pattern via the Kibana API: ```console -$ curl -XPUT -D- 'http://localhost:9200/.kibana/doc/index-pattern:docker-elk' \ +$ curl -XPOST -D- 'http://localhost:5601/api/saved_objects/index-pattern' \ -H 'Content-Type: application/json' \ - -d '{"type": "index-pattern", "index-pattern": {"title": "logstash-*", "timeFieldName": "@timestamp"}}' + -H 'kbn-version: 6.1.0' \ + -d '{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}' ``` -This will automatically be marked as the default index pattern as soon as the Kibana UI is opened for the first time. +The created pattern will automatically be marked as the default index pattern as soon as the Kibana UI is opened for the first time. ## Configuration