35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
|
[[ingest-node-set-security-user-processor]]
|
||
|
=== Set Security User Processor
|
||
|
Sets user-related details (such as `username`, `roles`, `email`, `full_name`
|
||
|
and `metadata` ) from the current
|
||
|
authenticated user to the current document by pre-processing the ingest.
|
||
|
|
||
|
IMPORTANT: Requires an authenticated user for the index request.
|
||
|
|
||
|
[[set-security-user-options]]
|
||
|
.Set Security User Options
|
||
|
[options="header"]
|
||
|
|======
|
||
|
| Name | Required | Default | Description
|
||
|
| `field` | yes | - | The field to store the user information into.
|
||
|
| `properties` | no | [`username`, `roles`, `email`, `full_name`, `metadata`] | Controls what user related properties are added to the `field`.
|
||
|
include::common-options.asciidoc[]
|
||
|
|======
|
||
|
|
||
|
The following example adds all user details for the current authenticated user
|
||
|
to the `user` field for all documents that are processed by this pipeline:
|
||
|
|
||
|
[source,js]
|
||
|
--------------------------------------------------
|
||
|
{
|
||
|
"processors" : [
|
||
|
{
|
||
|
"set_security_user": {
|
||
|
"field": "user"
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
--------------------------------------------------
|
||
|
// NOTCONSOLE
|