// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.security.putRole({
  name: "clicks_admin",
  run_as: ["clicks_watcher_1"],
  cluster: ["monitor"],
  indices: [
    {
      names: ["events-*"],
      privileges: ["read"],
      field_security: {
        grant: ["category", "@timestamp", "message"],
      },
      query: '{"match": {"category": "click"}}',
    },
  ],
});
console.log(response);
----
