Get enrich policy API

Returns information about an enrich policy.

GET /_enrich/policy/my-policy

Request

GET /_enrich/policy/<enrich-policy>

GET /_enrich/policy

GET /_enrich/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

<enrich-policy>

(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

GET /_enrich/policy/my-policy

The API returns the following response:

{
    "policies": [
        {
            "config": {
                "match": {
                    "name" : "my-policy",
                    "indices" : ["users"],
                    "match_field" : "email",
                    "enrich_fields" : [
                        "first_name",
                        "last_name",
                        "city",
                        "zip",
                        "state"
                    ]
                }
            }
        }
    ]
}

Get multiple policies

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

The API returns the following response:

{
    "policies": [
        {
            "config": {
                "match": {
                    "name" : "my-policy",
                    "indices" : ["users"],
                    "match_field" : "email",
                    "enrich_fields" : [
                        "first_name",
                        "last_name",
                        "city",
                        "zip",
                        "state"
                    ]
                }
            }
        },
        {
            "config": {
                "match": {
                    "name" : "other-policy",
                    "indices" : ["users"],
                    "match_field" : "email",
                    "enrich_fields" : [
                        "first_name",
                        "last_name",
                        "city",
                        "zip",
                        "state"
                    ]
                }
            }
        }
    ]
}

Get all policies

GET /_enrich/policy

The API returns the following response:

{
    "policies": [
        {
            "config": {
                "match": {
                    "name" : "my-policy",
                    "indices" : ["users"],
                    "match_field" : "email",
                    "enrich_fields" : [
                        "first_name",
                        "last_name",
                        "city",
                        "zip",
                        "state"
                    ]
                }
            }
        },
        {
            "config": {
                "match": {
                    "name" : "other-policy",
                    "indices" : ["users"],
                    "match_field" : "email",
                    "enrich_fields" : [
                        "first_name",
                        "last_name",
                        "city",
                        "zip",
                        "state"
                    ]
                }
            }
        }
    ]
}