How to filter roles which are having cluster is all privileges

Hi Team,

Could any one suggest How to filter roles which are having cluster is all privileges.

Thanks in Advance.

Hi @prabhakar_talari

The list roles API does not allow to specify conditions for the returned roles (besides for the name, of course).

Right now, I see two solutions to this problem of filtering role descriptors, or any ES internal meta data, for that matter:

  • least maintainable (portable between versions) is to query the .security index directly, bypassing the list roles API.
  • on the client side, use jq to parse the full output of the list roles API, and subsequently filter for the ones that match your criterion.

Both these solutions are temporal only, until the High Level Rest Client matures enough to include response objects for the get roles API. ETA for this is ES version 7. Then, you will not need jq, you will iterate over the roles on the client side using methods of the response objects.
Then this will be the sole recommended solution.

Let me know if you need help with any of the afore mentioned approaches.

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