# APM only capture 500 code requestBody ,can not caputure 200 requestBody

**URL:** <https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650>\
**Category:** APM\
**Tags:** java\
**Created:** [March 2, 2020, 9:13am UTC](https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650 "2020-03-02T09:13:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhipengLin](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zhipengLin](https://discuss.elastic.co/u/zhipengLin)\
**Post date:** [March 2, 2020, 9:13am UTC](https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650/1 "2020-03-02T09:13:38Z")

</div>

**Kibana version** :  
v7.6.0  
**Elasticsearch version** :  
v7.6.0  
**APM Server version** :  
v7.6.0  
**APM Agent language and version** :  
JAVA、1.13.0  
**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
I set the agent Configuration : -Delastic.apm.capture\_body=all  
and then I can see the http requestBody of status code 500, but I can not see the requestBody of status code 200. What can I do so that I can see all the requestBody both 200 and 500 status code. My request are Post and application/json

 ![200](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ec69904bb08ecf7c8033af31e18b158447a243a7.png) ![500](https://us1.discourse-cdn.com/elastic/original/3X/9/3/9324dd08b303065aa016e2f07d212cbd3e6b753c.png)

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 4, 2020, 6:22am UTC](https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650/2 "2020-03-04T06:22:51Z")

</div>

Hi and welcome to our forum!  
Please verify that those requests, for which you fail to get the body captured, are actually sent with a `Content-Type` header with a value that matches the [`capture_body_content_types` configuration](https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-capture-body-content-types).

---

<div class="post-metadata">

**Author:** ![zhipengLin](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zhipengLin](https://discuss.elastic.co/u/zhipengLin)\
**Post date:** [March 6, 2020, 4:26am UTC](https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650/3 "2020-03-06T04:26:41Z")

</div>

yes I see the configration and my content-Type is in the default , so I did not set the capture-body-content-types specially

---

<div class="post-metadata">

**Author:** ![zhipengLin](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zhipengLin](https://discuss.elastic.co/u/zhipengLin)\
**Post date:** [March 6, 2020, 4:28am UTC](https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650/4 "2020-03-06T04:28:09Z")

</div>

I try to set capture-body-content-types specially=\*  
and I find I can receive the request body ,I m guess that your document have some wrong.  
because my content-Type is application/json ，

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 8, 2020, 5:30am UTC](https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650/5 "2020-03-08T05:30:10Z")

</div>

Thanks for letting us know.  
If you could reproduce the problem and send **ALL** headers sent with a request where the agent failed to capture body using the original configuration, that would be very useful for us.

---

<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:** [March 29, 2020, 1:30am UTC](https://discuss.elastic.co/t/apm-only-capture-500-code-requestbody-can-not-caputure-200-requestbody/221650/6 "2020-03-29T01:30:12Z")

</div>

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