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

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:

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

If the expected metrics are 2, like this:

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

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

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 processor to parse it, and possibly the painless processor to move fields around.

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. You can either use the global processors directive or the per-monitor processors setting.

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