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
|
|
|
{
|
|
|
|
"mappings" : {
|
|
|
|
"properties" : {
|
|
|
|
"email" : { "type" : "keyword" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
{
|
|
|
|
"match": {
|
|
|
|
"indices": "users",
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": ["first_name", "last_name", "city", "zip", "state"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----
|
|
|
|
// 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-09-09 08:44:56 -04:00
|
|
|
// tag::update-enrich-policy[]
|
2019-11-19 16:38:13 -05:00
|
|
|
[WARNING]
|
|
|
|
====
|
|
|
|
Once created, you can't update or change an enrich policy.
|
2019-09-04 14:11:52 -04:00
|
|
|
Instead, you can:
|
|
|
|
|
2019-11-19 16:38:13 -05:00
|
|
|
. Create and <<execute-enrich-policy-api,execute>> a new enrich policy.
|
2019-09-04 14:11:52 -04:00
|
|
|
|
|
|
|
. Replace the previous enrich policy
|
|
|
|
with the new enrich policy
|
|
|
|
in any in-use enrich processors.
|
|
|
|
|
2019-09-23 13:23:26 -04:00
|
|
|
. Use the <<delete-enrich-policy-api, delete enrich policy>> API
|
2019-09-04 14:11:52 -04:00
|
|
|
to delete the previous enrich policy.
|
2019-11-19 16:38:13 -05:00
|
|
|
====
|
2019-09-09 08:44:56 -04:00
|
|
|
// end::update-enrich-policy[]
|
2019-09-04 14:11:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[put-enrich-policy-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<enrich-policy>`::
|
|
|
|
(Required, string)
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=enrich-policy]
|
|
|
|
|
|
|
|
|
|
|
|
[[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
|
|
|
--
|