2019-09-04 14:11:52 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
|
|
|
[[get-enrich-policy-api]]
|
|
|
|
=== Get enrich policy API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Get enrich policy</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
2019-11-19 16:38:13 -05:00
|
|
|
Returns information about an <<enrich-policy,enrich policy>>.
|
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 /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
|
|
|
|
|
|
|
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
|
|
|
}
|
2019-09-10 11:42:28 -04:00
|
|
|
|
|
|
|
PUT /_enrich/policy/other-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-10 11:42:28 -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
|
|
|
--------------------------------------------------
|
|
|
|
GET /_enrich/policy/my-policy
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
|
|
|
|
[[get-enrich-policy-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
2020-02-19 20:33:06 -05:00
|
|
|
`GET /_enrich/policy/<name>`
|
2019-09-04 14:11:52 -04:00
|
|
|
|
|
|
|
`GET /_enrich/policy`
|
|
|
|
|
2020-05-05 12:30:17 -04:00
|
|
|
`GET /_enrich/policy/policy1,policy2`
|
2019-09-10 11:42:28 -04:00
|
|
|
|
2019-09-04 14:11:52 -04:00
|
|
|
|
|
|
|
[[get-enrich-policy-api-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
include::put-enrich-policy.asciidoc[tag=enrich-policy-api-prereqs]
|
|
|
|
|
|
|
|
|
|
|
|
[[get-enrich-policy-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
2020-02-19 20:33:06 -05:00
|
|
|
`<name>`::
|
2019-09-18 08:30:22 -04:00
|
|
|
+
|
|
|
|
--
|
2019-09-04 14:11:52 -04:00
|
|
|
(Optional, string)
|
2019-09-18 08:30:22 -04:00
|
|
|
Comma-separated list of enrich policy names
|
|
|
|
used to limit the request.
|
|
|
|
|
|
|
|
To return information for all enrich policies,
|
|
|
|
omit this parameter.
|
|
|
|
--
|
2019-09-04 14:11:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[get-enrich-policy-api-example]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
|
|
|
|
|
|
[[get-enrich-policy-api-single-ex]]
|
|
|
|
===== Get a single policy
|
|
|
|
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console]
|
2019-09-04 14:11:52 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_enrich/policy/my-policy
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
The API returns the following response:
|
|
|
|
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console-result]
|
2019-09-04 14:11:52 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"policies": [
|
|
|
|
{
|
|
|
|
"config": {
|
|
|
|
"match": {
|
|
|
|
"name": "my-policy",
|
|
|
|
"indices": [ "users" ],
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": [
|
|
|
|
"first_name",
|
|
|
|
"last_name",
|
|
|
|
"city",
|
|
|
|
"zip",
|
|
|
|
"state"
|
|
|
|
]
|
2019-09-04 14:11:52 -04:00
|
|
|
}
|
2020-07-21 15:49:58 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-09-04 14:11:52 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
2019-09-10 11:42:28 -04:00
|
|
|
[[get-enrich-policy-api-commas-ex]]
|
|
|
|
===== Get multiple policies
|
|
|
|
|
2019-09-30 02:04:18 -04:00
|
|
|
[source,console]
|
2019-09-10 11:42:28 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_enrich/policy/my-policy,other-policy
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
The API returns the following response:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"policies": [
|
|
|
|
{
|
|
|
|
"config": {
|
|
|
|
"match": {
|
|
|
|
"name": "my-policy",
|
|
|
|
"indices": [ "users" ],
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": [
|
|
|
|
"first_name",
|
|
|
|
"last_name",
|
|
|
|
"city",
|
|
|
|
"zip",
|
|
|
|
"state"
|
|
|
|
]
|
2019-09-10 11:42:28 -04:00
|
|
|
}
|
2020-07-21 15:49:58 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"config": {
|
|
|
|
"match": {
|
|
|
|
"name": "other-policy",
|
|
|
|
"indices": [ "users" ],
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": [
|
|
|
|
"first_name",
|
|
|
|
"last_name",
|
|
|
|
"city",
|
|
|
|
"zip",
|
|
|
|
"state"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-09-10 11:42:28 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE
|
|
|
|
|
|
|
|
|
2019-09-04 14:11:52 -04:00
|
|
|
[[get-enrich-policy-api-all-ex]]
|
|
|
|
===== Get all policies
|
|
|
|
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console]
|
2019-09-04 14:11:52 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_enrich/policy
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
The API returns the following response:
|
|
|
|
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console-result]
|
2019-09-04 14:11:52 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"policies": [
|
|
|
|
{
|
|
|
|
"config": {
|
|
|
|
"match": {
|
|
|
|
"name": "my-policy",
|
|
|
|
"indices": [ "users" ],
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": [
|
|
|
|
"first_name",
|
|
|
|
"last_name",
|
|
|
|
"city",
|
|
|
|
"zip",
|
|
|
|
"state"
|
|
|
|
]
|
2019-09-04 14:11:52 -04:00
|
|
|
}
|
2020-07-21 15:49:58 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"config": {
|
|
|
|
"match": {
|
|
|
|
"name": "other-policy",
|
|
|
|
"indices": [ "users" ],
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": [
|
|
|
|
"first_name",
|
|
|
|
"last_name",
|
|
|
|
"city",
|
|
|
|
"zip",
|
|
|
|
"state"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
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
|
|
|
--------------------------------------------------
|
|
|
|
DELETE /_enrich/policy/my-policy
|
2019-09-10 11:42:28 -04:00
|
|
|
DELETE /_enrich/policy/other-policy
|
2019-09-04 14:11:52 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
////
|