# How to adjust apm client .setLabel() index field type to "geo\_point"

**URL:** <https://discuss.elastic.co/t/how-to-adjust-apm-client-setlabel-index-field-type-to-geo-point/226994>\
**Category:** APM\
**Tags:** nodejs, server\
**Created:** [April 7, 2020, 6:59pm UTC](https://discuss.elastic.co/t/how-to-adjust-apm-client-setlabel-index-field-type-to-geo-point/226994 "2020-04-07T18:59:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [April 8, 2020, 8:05am UTC](https://discuss.elastic.co/t/how-to-adjust-apm-client-setlabel-index-field-type-to-geo-point/226994/2 "2020-04-08T08:05:47Z")

</div>

@rgroleau welcome to the forum!

What you're recording sounds to me like it fits with the definition of [client](https://www.elastic.co/guide/en/ecs/current/ecs-client.html).[geo.location](https://www.elastic.co/guide/en/ecs/current/ecs-geo.html) in ECS (Elastic Common Schema). I think it would be sensible for the Elastic APM agents to provide a more specific API to record this information, and then we could record it with the correct field name and type – something like the `apm.setGeoLocation()` you propose.

Would that work for you? If so, I'll open a feature request to track it.

In the mean time you can use an [Ingest node](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html) pipeline to rename `labels.location` to `client.geo.location`:

1. Create a "rename\_location" pipeline:

```auto
PUT /_ingest/pipeline/rename_location
{
  "description" : "rename labels.location to client.geo.location",
  "processors" : [
    {
      "rename" : {
        "field": "labels.location",
        "target_field": "client.geo.location",
        "ignore_missing": true
      }
    }
  ]
}

```

1. Query the existing "apm" pipeline:

```auto
GET /_ingest/pipeline/apm

```

Elasticsearch responds with something like::

```auto
{
  "apm" : {
    "description" : "Default enrichment for APM events",
    "processors" : [
      {
        "pipeline" : {
          "name" : "apm_user_agent"
        }
      },
      {
        "pipeline" : {
          "name" : "apm_user_geo"
        }
      },
      {
        "pipeline" : {
          "name" : "apm_ingest_timestamp"
        }
      }
    ]
  }
}

```

1. Update "apm" pipeline to call the new "rename\_locations" pipeline:

```auto
PUT /_ingest/pipeline/apm
{
  "description": "Default enrichment for APM events",
  "processors": [
    {
      "pipeline": {
        "name": "apm_user_agent"
      }
    },
    {
      "pipeline": {
        "name": "apm_user_geo"
      }
    },
    {
      "pipeline": {
        "name": "apm_ingest_timestamp"
      }
    },
    {
      "pipeline": {
        "name": "rename_location"
      }
    }
  ]
}

```

---

_[View the full topic](https://discuss.elastic.co/t/how-to-adjust-apm-client-setlabel-index-field-type-to-geo-point/226994)._
