1
0

set-security-user.asciidoc 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. [[ingest-node-set-security-user-processor]]
  2. === Set Security User Processor
  3. Sets user-related details (such as `username`, `roles`, `email`, `full_name`
  4. and `metadata` ) from the current
  5. authenticated user to the current document by pre-processing the ingest.
  6. IMPORTANT: Requires an authenticated user for the index request.
  7. [[set-security-user-options]]
  8. .Set Security User Options
  9. [options="header"]
  10. |======
  11. | Name | Required | Default | Description
  12. | `field` | yes | - | The field to store the user information into.
  13. | `properties` | no | [`username`, `roles`, `email`, `full_name`, `metadata`] | Controls what user related properties are added to the `field`.
  14. include::common-options.asciidoc[]
  15. |======
  16. The following example adds all user details for the current authenticated user
  17. to the `user` field for all documents that are processed by this pipeline:
  18. [source,js]
  19. --------------------------------------------------
  20. {
  21. "processors" : [
  22. {
  23. "set_security_user": {
  24. "field": "user"
  25. }
  26. }
  27. ]
  28. }
  29. --------------------------------------------------
  30. // NOTCONSOLE