[
{
  "id": "apm",
  "body": {
    "description" : "Default enrichment for APM events",
    "processors" : [
      {
        "pipeline": {
          "name": "apm_user_agent"
        }
      },
      {
        "pipeline": {
          "name": "apm_user_geo"
        }
      }
    ]
  }
},
{
  "id": "apm_user_agent",
  "body": {
    "description" : "Add user agent information for APM events",
    "processors" : [
      {
        "user_agent" : {
          "field": "user_agent.original",
          "target_field": "user_agent",
          "ignore_missing": true,
          "ignore_failure": true
        }
      }
    ]
  }
},
{
  "id": "apm_user_geo",
  "body": {
    "description" : "Add user geo information for APM events",
    "processors" : [
      {
        "geoip" : {
          "database_file": "GeoLite2-City.mmdb",
          "field": "client.ip",
          "target_field": "client.geo",
          "ignore_missing": true,
          "on_failure": [
            {
              "remove": {
                  "field": "client.ip",
                  "ignore_missing": true,
                  "ignore_failure": true
              }
            }
          ]
        }
      }
    ]
  }
}
]
