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>
|
|
|
|
++++
|
|
|
|
|
|
|
|
Returns information about an enrich policy.
|
|
|
|
|
|
|
|
////
|
2019-09-12 10:13:21 -04:00
|
|
|
[source,console]
|
2019-09-04 14:11:52 -04:00
|
|
|
----
|
|
|
|
PUT /users
|
|
|
|
|
|
|
|
PUT /_enrich/policy/my-policy
|
|
|
|
{
|
|
|
|
"match": {
|
|
|
|
"indices": "users",
|
|
|
|
"match_field": "email",
|
|
|
|
"enrich_fields": ["first_name", "last_name", "city", "zip", "state"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----
|
|
|
|
////
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
`GET /_enrich/policy/<enrich-policy>`
|
|
|
|
|
|
|
|
`GET /_enrich/policy`
|
|
|
|
|
|
|
|
|
|
|
|
[[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}
|
|
|
|
|
|
|
|
`<enrich-policy>`::
|
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
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"policies": [
|
|
|
|
{
|
|
|
|
"match": {
|
|
|
|
"name" : "my-policy",
|
|
|
|
"indices" : ["users"],
|
|
|
|
"match_field" : "email",
|
|
|
|
"enrich_fields" : [
|
|
|
|
"first_name",
|
|
|
|
"last_name",
|
|
|
|
"city",
|
|
|
|
"zip",
|
|
|
|
"state"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
[[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
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"policies": [
|
|
|
|
{
|
|
|
|
"match": {
|
|
|
|
"name" : "my-policy",
|
|
|
|
"indices" : ["users"],
|
|
|
|
"match_field" : "email",
|
|
|
|
"enrich_fields" : [
|
|
|
|
"first_name",
|
|
|
|
"last_name",
|
|
|
|
"city",
|
|
|
|
"zip",
|
|
|
|
"state"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
////
|
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]
|
|
|
|
////
|