How to display role names only

Hi All,

Could any one suggest me best command to get list of roles, i am using command (GET _xpack/security/role) but it is giving the result in JSON format, but i would like to display only role names

thanks in advance

Hello ,

There is no way to do what you want with the Get roles API. You can process the result on the client side though and do the filtering you want, by using tools such as jq

For example, this

curl -X GET -u youruser:yourpassword http://yourserver:9200/_xpack/security/role | jq 'keys | .[]'

will print the names of the roles that are defined in your native roles store.

Thank you. It worked as expected !

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