# Elastic APM Java agent - sanitize\_fields\_names on application/json\* data

**URL:** <https://discuss.elastic.co/t/elastic-apm-java-agent-sanitize-fields-names-on-application-json-data/211209>\
**Category:** APM\
**Tags:** java\
**Created:** [December 10, 2019, 2:04am UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-sanitize-fields-names-on-application-json-data/211209 "2019-12-10T02:04:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuZhenXie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuzhenxie/32/59077_2.png) [@YuZhenXie](https://discuss.elastic.co/u/YuZhenXie)\
**Post date:** [December 10, 2019, 2:04am UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-sanitize-fields-names-on-application-json-data/211209/1 "2019-12-10T02:04:58Z")

</div>

Is it possible to support **sanitize\_fields\_names** configuration for `application/json*` data?Sometimes, requests body contains sensitive data sent to APM when **capture\_body** is enabled.

We hope those fields can be sanitized. We have one way to sanitize them, which is to sanitize/filter out them by ourselves and add them into custom context manually, but we wonder is it possible that Elastic support this function or any suggestion?

Thank you!

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [December 10, 2019, 8:56am UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-sanitize-fields-names-on-application-json-data/211209/2 "2019-12-10T08:56:42Z")

</div>

Hi @YuZhenXie,

Filtering JSON data at agent level is not supported right now.

However, you can filter data by changing the ingest pipeline used by APM server, which has quite a few advantages:

- support for more than just "field name matching", you have access to all ingest pipeline features
- no performance overhead on the application

[https://www.elastic.co/guide/en/apm/server/current/elasticsearch-output.html#pipeline-option-es](https://www.elastic.co/guide/en/apm/server/current/elasticsearch-output.html#pipeline-option-es)  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/remove-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/remove-processor.html)

---

<div class="post-metadata">

**Author:** ![YuZhenXie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuzhenxie/32/59077_2.png) [@YuZhenXie](https://discuss.elastic.co/u/YuZhenXie)\
**Post date:** [December 11, 2019, 4:36pm UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-sanitize-fields-names-on-application-json-data/211209/3 "2019-12-11T16:36:37Z")

</div>

Hi @Sylvain_Juge,

Thanks for your suggestion! I will try it then!

---

<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:** [January 1, 2020, 12:36pm UTC](https://discuss.elastic.co/t/elastic-apm-java-agent-sanitize-fields-names-on-application-json-data/211209/4 "2020-01-01T12:36:43Z")

</div>

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