Adding new user in role mapping

HI Team,
I'm trying to add new user in my existing role mapping and when i perform the action it delete all the existing user from it and create the new user which im parsing.

I need to append this in my existing role mapping and how to achieve it.

POST /_security/role_mapping/elk_admin_team_test
{
"roles": [ "superuser"],
"enabled": true,
"rules": {
"field" : { "username" : "ganesh" }
},
"metadata" : {
"version" : 1
}
}

Hi,

This is because the update of a role mapping does not "add" but "overwrites", you use the api to define how it should look, no matter of the current state.

I also responded to your question about removing users; You can use the same approach here by first retrieving the current implementation and then updating it with the desired set.

Another approach you could take is to use Terraform if you are familiar, it can handle the logic for you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.