I use the Kibana API for this: https://www.elastic.co/guide/en/kibana/master/saved-objects-api-create.html
And it wok. But after installing plugin Searchguard , it don't work. Need autorization.
I try:
1)Authenticate against Kibana:
$ curl -XPOST -D- 'http://localhost:5601/api/v1/auth/login'
-c /tmp/sg_cookies
-H 'Content-Type: application/json'
-H 'kbn-xsrf: true'
-d '{"username":"user","password":"password"}'
2)Create an index pattern via the Kibana API:
$ curl -XPOST -D- 'http://localhost:5601/api/saved_objects/index-pattern'
-b /tmp/sg_cookies
-H 'Content-Type: application/json'
-H 'kbn-xsrf: true'
-d '{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}'
But Authenticate don't work(
Help me please, what am I doing wrong?