Difficulty creating role

I'm trying to create a role using the command as described in the doc's ( I'm using elastic 8.7)

curl -X POST "localhost:9200/_security/role/myprofile?pretty" -H 'Content-Type: application/json' -d'
 {
   "indices": [
     {
       "names": [ "events-*" ],
       "privileges": [ "read","write" ]
     }
   ]
 }
 '

But it results in an error, "no handler found for uri [/_security/role/myprofile?pretty] and method [POST].

Any idea what Im doing wrong?

Can you remove the ?pretty part of the URL and try again?

Yes sorry should have mentioned that. I tried without the pretty, but same error

I have a basic license, is that maybe the problem? Naa, then it should have mentioned something along those lines right?

What does your node configuration look like? Do you have security enabled?

No, it works with the Basic license, but I think @Christian_Dahlqvist has a point and I just saw it now.

On the request you are not authenticating yourself, there is no user/password.

Do you have security enabled?

Yep @Christian_Dahlqvist you are spot on. I was pretty sure I did have it enabled but turns out I disabled it again at some point! Thanks for pointing me in the right direction.

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