# Full body response to elasticsearch

**URL:** <https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [September 18, 2019, 10:32am UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973 "2019-09-18T10:32:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![coachbjork](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@coachbjork](https://discuss.elastic.co/u/coachbjork)\
**Post date:** [September 18, 2019, 10:32am UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/1 "2019-09-18T10:32:12Z")

</div>

I am trying to figure out how to index the full body response into elastics using Heartbeat.

I found this: [Send body response to Elastic](https://discuss.elastic.co/t/send-body-response-to-elastic/188516)  
And it is now solved, but seems to only be during errors.

I am trying to put up a monitor of different API servers and this data is a key factor to make sure the API provides the intended requests.

Do I need to edit the heartbeat template, or some processor?  
I'm pretty new to elasticsearch and I'd love any help here.

Thanks  
Anders

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [September 18, 2019, 11:35am UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/2 "2019-09-18T11:35:11Z")

</div>

Which version are you running? The code has been merged, but it won't be released until 7.4.0.

---

<div class="post-metadata">

**Author:** ![coachbjork](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@coachbjork](https://discuss.elastic.co/u/coachbjork)\
**Post date:** [September 18, 2019, 2:04pm UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/3 "2019-09-18T14:04:06Z")

</div>

Hey, currently running 7.0.0

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [September 24, 2019, 10:02pm UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/4 "2019-09-24T22:02:46Z")

</div>

I'm sorry but you'll have to wait till 7.4.0 is released and then upgrade to that.

---

<div class="post-metadata">

**Author:** ![jvdm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jvdm/32/12707_2.png) [@jvdm](https://discuss.elastic.co/u/jvdm)\
**Post date:** [October 15, 2019, 9:56am UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/5 "2019-10-15T09:56:04Z")

</div>

Does anyone have this working? I'm using heartbeat 7.4.0 with the following config, however the http.response.body.content field in Elastic is empty, and interestingly the http.response.body.bytes is 0:

```
heartbeat.monitors:
- type: http
  urls: ["http://localhost:5000/status"]
  schedule: '@every 30s'
  response.include_body: always
  response.include_body_max_bytes: 2048
  check.request.method: GET
  check.response:
    status: 200
    json:
      - description: check status
        condition:
          equals:
            status: running
  processors:
    - decode_json_fields:
        fields: ["http.response.body.content"]

```

A curl to the /status endpoint returns:

`{"name":"MODEL_SERVER","status":"running","version":"1.3.3"}`

What I would like to do is add the "version" JSON field and value into the document in Elastic.

The check response above works with the JSON condition "status" = "running", so the JSON object is there and being parsed. All I would like is to add that JSON object into a root field. 🙂

thanks!

---

<div class="post-metadata">

**Author:** ![philippkahr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philippkahr/32/100137_2.png) [@philippkahr](https://discuss.elastic.co/u/philippkahr)\
**Post date:** [November 10, 2019, 12:14pm UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/6 "2019-11-10T12:14:01Z")

</div>

Hi,

I am running into the exact same issue. The `decode_json_fields` is not triggered. i can see the body in the discover tab and I see the entire json document there as a single string.

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [November 10, 2019, 12:26pm UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/7 "2019-11-10T12:26:19Z")

</div>

This is a confirmed bug and should be fixed in the upcoming 7.5 release.

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [November 10, 2019, 9:00pm UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/8 "2019-11-10T21:00:10Z")

</div>

To add more detail here. When this feature was merged it contained a bug where validating the body would read the buffer and leave 0 bytes remaining for a second stage here we would excerpt the body and record its size.

This was fixed in [https://github.com/elastic/beats/pull/14310](https://github.com/elastic/beats/pull/14310) which is targeted for the 7.5 release.

---

<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:** [December 8, 2019, 9:00pm UTC](https://discuss.elastic.co/t/full-body-response-to-elasticsearch/199973/9 "2019-12-08T21:00:17Z")

</div>

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