# \[heartbeat\]: add feature to support returning multiple metrics for a single http check

**URL:** <https://discuss.elastic.co/t/heartbeat-add-feature-to-support-returning-multiple-metrics-for-a-single-http-check/264331>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [February 15, 2021, 3:37pm UTC](https://discuss.elastic.co/t/heartbeat-add-feature-to-support-returning-multiple-metrics-for-a-single-http-check/264331 "2021-02-15T15:37:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lowry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lowry/32/77489_2.png) [@lowry](https://discuss.elastic.co/u/lowry)\
**Post date:** [February 15, 2021, 3:37pm UTC](https://discuss.elastic.co/t/heartbeat-add-feature-to-support-returning-multiple-metrics-for-a-single-http-check/264331/1 "2021-02-15T15:37:56Z")

</div>

Hello Beats friends,  
Wondering if current Heartbeat supports returning multiple metrics for single http check?  
What I means here is that, if a single http check returns multiple desired key/value pairs, like the following( no mattern the resonse is XML format or JSON format), taking response as JSON format for instance:

```auto
{
    "key1": "up",
    "key2": "down",
}

```

If the expected metrics are 2, like this:

```auto
key1{_namespace_="name1", dimension1="xxx"...}
key2{_namespace_="name2", dimension1="yyy"...}

```

We could support fetching different key/value pairs based on the different HB configs.

---

<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:** [February 19, 2021, 8:46pm UTC](https://discuss.elastic.co/t/heartbeat-add-feature-to-support-returning-multiple-metrics-for-a-single-http-check/264331/2 "2021-02-19T20:46:38Z")

</div>

Hi @lowry I assume you mean that this would be in a JSON HTTP body? If so, I'd use an Elasticsearch ingest processor to handle this.

I'd use the [JSON](https://www.elastic.co/guide/en/elasticsearch/reference/current/json-processor.html) processor to parse it, and possibly the painless processor to move fields around.

---

<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:** [February 19, 2021, 8:47pm UTC](https://discuss.elastic.co/t/heartbeat-add-feature-to-support-returning-multiple-metrics-for-a-single-http-check/264331/3 "2021-02-19T20:47:57Z")

</div>

I'm also just now remembering beats has a script processor you could use, support for which I just merged in [Cherry-pick #23229 to 7.x: [Heartbeat] Enable script processor by andrewvc · Pull Request #23768 · elastic/beats · GitHub](https://github.com/elastic/beats/pull/23768). You can either use the global `processors` directive or the per-monitor `processors` setting.

---

<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 19, 2021, 10:48pm UTC](https://discuss.elastic.co/t/heartbeat-add-feature-to-support-returning-multiple-metrics-for-a-single-http-check/264331/4 "2021-03-19T22:48:30Z")

</div>

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