Get enrich policy API

Returns information about an enrich policy.

  1. GET /_enrich/policy/my-policy

Request

GET /_enrich/policy/<name>

GET /_enrich/policy

GET /_enrich/policy/policy1,policy2

Prerequisites

If you use Elasticsearch security features, you must have:

  • read index privileges for any indices used
  • The enrich_user built-in role

Path parameters

<name>

(Optional, string) Comma-separated list of enrich policy names used to limit the request.

To return information for all enrich policies, omit this parameter.

Examples

Get a single policy

  1. GET /_enrich/policy/my-policy

The API returns the following response:

  1. {
  2. "policies": [
  3. {
  4. "config": {
  5. "match": {
  6. "name": "my-policy",
  7. "indices": [ "users" ],
  8. "match_field": "email",
  9. "enrich_fields": [
  10. "first_name",
  11. "last_name",
  12. "city",
  13. "zip",
  14. "state"
  15. ]
  16. }
  17. }
  18. }
  19. ]
  20. }

Get multiple policies

  1. GET /_enrich/policy/my-policy,other-policy

The API returns the following response:

  1. {
  2. "policies": [
  3. {
  4. "config": {
  5. "match": {
  6. "name": "my-policy",
  7. "indices": [ "users" ],
  8. "match_field": "email",
  9. "enrich_fields": [
  10. "first_name",
  11. "last_name",
  12. "city",
  13. "zip",
  14. "state"
  15. ]
  16. }
  17. }
  18. },
  19. {
  20. "config": {
  21. "match": {
  22. "name": "other-policy",
  23. "indices": [ "users" ],
  24. "match_field": "email",
  25. "enrich_fields": [
  26. "first_name",
  27. "last_name",
  28. "city",
  29. "zip",
  30. "state"
  31. ]
  32. }
  33. }
  34. }
  35. ]
  36. }

Get all policies

  1. GET /_enrich/policy

The API returns the following response:

  1. {
  2. "policies": [
  3. {
  4. "config": {
  5. "match": {
  6. "name": "my-policy",
  7. "indices": [ "users" ],
  8. "match_field": "email",
  9. "enrich_fields": [
  10. "first_name",
  11. "last_name",
  12. "city",
  13. "zip",
  14. "state"
  15. ]
  16. }
  17. }
  18. },
  19. {
  20. "config": {
  21. "match": {
  22. "name": "other-policy",
  23. "indices": [ "users" ],
  24. "match_field": "email",
  25. "enrich_fields": [
  26. "first_name",
  27. "last_name",
  28. "city",
  29. "zip",
  30. "state"
  31. ]
  32. }
  33. }
  34. }
  35. ]
  36. }