# Filter APM metrics with Logstash in Elastic Cloud

**URL:** <https://discuss.elastic.co/t/filter-apm-metrics-with-logstash-in-elastic-cloud/204055>\
**Category:** APM\
**Tags:** server\
**Created:** [October 17, 2019, 12:58pm UTC](https://discuss.elastic.co/t/filter-apm-metrics-with-logstash-in-elastic-cloud/204055 "2019-10-17T12:58:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivachandran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sivachandran/32/55150_2.png) [@sivachandran](https://discuss.elastic.co/u/sivachandran)\
**Post date:** [October 17, 2019, 12:58pm UTC](https://discuss.elastic.co/t/filter-apm-metrics-with-logstash-in-elastic-cloud/204055/1 "2019-10-17T12:58:56Z")

</div>

I'm using Elastic Cloud. I've integrated APM with my services. The metrics are pushed to APM Server(i.e. deployment) and I can see them in Kibana.

I would like to manipulate certain custom labels of my APM metrics(e.g. IP to Geo). I know I can do this through Logstash(available as part my deployment) pipeline. I tried creating a pipeline with the following pipeline body. But it doesn't the geo field that I'm trying to add. I'm not sure whether Logstash is even receiving the data. Is there any other config I need to do on my deployment to make APM Server route the data through Logstash?

```
input {
   beats {
       port => 5044
   }
}
filter {
   geoip {
       source => "labels.app_client_ip"
       target => "labels.app_client_geo"

   }
}
output {
   elasticsearch {
       hosts => ["[http://localhost:9200](http://localhost:9200/)"]
       index => "%{[@metadata][index]}"
   }
}

```

Thanks.

---

<div class="post-metadata">

**Author:** ![jalvz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jalvz/32/45613_2.png) [@jalvz](https://discuss.elastic.co/u/jalvz)\
**Post date:** [October 18, 2019, 7:36am UTC](https://discuss.elastic.co/t/filter-apm-metrics-with-logstash-in-elastic-cloud/204055/2 "2019-10-18T07:36:47Z")

</div>

Hi,

You would need to configure the Logstash output on apm server if you didn't do that already: [https://www.elastic.co/guide/en/apm/server/7.4/logstash-output.html](https://www.elastic.co/guide/en/apm/server/7.4/logstash-output.html)

Apm server provides a geo pipeline by default from versions \>= 7.3 which might also suit your needs without requiring Logstash. Check [https://www.elastic.co/guide/en/apm/server/7.4/configuring-ingest-node.html](https://www.elastic.co/guide/en/apm/server/7.4/configuring-ingest-node.html)

Hope that helps!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 8, 2019, 3:37am UTC](https://discuss.elastic.co/t/filter-apm-metrics-with-logstash-in-elastic-cloud/204055/3 "2019-11-08T03:37:03Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
