2019-09-04 14:11:52 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
|
|
|
[[put-enrich-policy-api]]
|
|
|
|
=== Put enrich policy API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Put enrich policy</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
|
|
|
Creates an enrich policy.
|
|
|
|
|
|
|
|
////
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console]
|
2019-09-04 14:11:52 -04:00
|
|
|
----
|
|
|
|
PUT /users
|
2019-10-22 01:38:16 -04:00
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"mappings": {
|
|
|
|
"properties": {
|
|
|
|
"email": { "type": "keyword" }
|
2019-10-22 01:38:16 -04:00
|
|
|
}
|
2020-07-21 15:49:58 -04:00
|
|
|
}
|
2019-10-22 01:38:16 -04:00
|
|
|
}
|
2019-09-04 14:11:52 -04:00
|
|
|
----
|
|
|
|
////
|
|
|
|
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console]
|
2019-09-04 14:11:52 -04:00
|
|
|
----
|
|
|
|
PUT /_enrich/policy/my-policy
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"match": {
|
|
|
|
"indices": "users",
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": ["first_name", "last_name", "city", "zip", "state"]
|
|
|
|
}
|
2019-09-04 14:11:52 -04:00
|
|
|
}
|
|
|
|
----
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
////
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console]
|
2019-09-04 14:11:52 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
DELETE /_enrich/policy/my-policy
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
////
|
|
|
|
|
|
|
|
|
|
|
|
[[put-enrich-policy-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`PUT /_enrich/policy/<enrich-policy>`
|
|
|
|
|
|
|
|
|
|
|
|
[[put-enrich-policy-api-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
// tag::enrich-policy-api-prereqs[]
|
|
|
|
If you use {es} {security-features}, you must have:
|
|
|
|
|
|
|
|
* `read` index privileges for any indices used
|
2019-11-25 15:59:59 -05:00
|
|
|
* The `enrich_user` <<built-in-roles,built-in role>>
|
2019-09-04 14:11:52 -04:00
|
|
|
// end::enrich-policy-api-prereqs[]
|
|
|
|
|
|
|
|
|
|
|
|
[[put-enrich-policy-api-desc]]
|
|
|
|
==== {api-description-title}
|
|
|
|
|
|
|
|
Use the put enrich policy API
|
2019-11-19 16:38:13 -05:00
|
|
|
to create a new <<enrich-policy,enrich policy>>.
|
2019-09-04 14:11:52 -04:00
|
|
|
|
2019-11-19 16:38:13 -05:00
|
|
|
[WARNING]
|
|
|
|
====
|
2020-03-12 05:57:23 -04:00
|
|
|
include::../../enrich.asciidoc[tag=update-enrich-policy]
|
2019-11-19 16:38:13 -05:00
|
|
|
====
|
2020-03-12 05:57:23 -04:00
|
|
|
|
2019-09-04 14:11:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[put-enrich-policy-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<enrich-policy>`::
|
|
|
|
(Required, string)
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=enrich-policy]
|
2019-09-04 14:11:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[put-enrich-policy-api-request-body]]
|
|
|
|
==== {api-request-body-title}
|
|
|
|
|
|
|
|
`<policy-type>`::
|
|
|
|
+
|
|
|
|
--
|
2019-11-19 16:38:13 -05:00
|
|
|
(Required, <<enrich-policy-definition,enrich policy>> object)
|
|
|
|
Enrich policy used to match and add the right enrich data to
|
|
|
|
the right incoming documents.
|
2019-10-09 08:39:11 -04:00
|
|
|
|
2019-11-19 16:38:13 -05:00
|
|
|
See <<enrich-policy-definition>> for object definition and parameters.
|
2019-09-04 14:11:52 -04:00
|
|
|
--
|