Skip to content

Instantly share code, notes, and snippets.

@kstefan
Created February 22, 2018 18:04
Show Gist options
  • Select an option

  • Save kstefan/1ffcb9527fbbb3a56e5c16776ca448e6 to your computer and use it in GitHub Desktop.

Select an option

Save kstefan/1ffcb9527fbbb3a56e5c16776ca448e6 to your computer and use it in GitHub Desktop.
Create Elasticsearch User
curl -XPOST -u elastic 'http://elastic:9200/_xpack/security/role/my_role' -H "Content-Type: application/json" -d '{
"indices" : [
{
"names" : [ "indexPrefix*" ],
"privileges" : [ "all" ]
}
]
}'
curl -XPOST -u elastic 'http://elastic:9200/_xpack/security/user/my_username' -H "Content-Type: application/json" -d '{
"password" : "password",
"full_name" : "Full name",
"email" : "email@example.com",
"roles" : [ "my_role" ]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment