Hello,
I was looking for a way to mostly set this up for my users before they login. I found a few API calls that can set the default index-pattern for my Space (users). I'll use that for automation:
Fetch index-pattern unique id
curl -s -u elastic:password -XGET "https://kibana_host:5601/s/users/api/saved_objects/_find?type=index-pattern&search_fields=title&search=apm*&fields=id" -k
Set defaultIndex with unique id fetched above:
curl -s -u elastic:password -XPOST -H "Content-Type: application/json" -H "kbn-xsrf: true" https://kibana_host:5601/s/users/api/kibana/settings -d '{"changes":{"defaultIndex":"12345678-1234-1234-1234-123456789012"}}' -k
Thank you for your help.
Joey