Heartbeat

I have a json response

{
    "applications": [
        {
            "name": "APP1",
            "instances": [
                {
                    "instanceId": "app1",
                    "healthCheckUrl": "http",
                    "statusPageUrl": "url",
                    "homePageUrl": "url",
                    "status": "UP"
                }
            ]
        },
        {
            "name": "app2",
            "instances": [
                {
                    "instanceId": "idname",
                    "healthCheckUrl": "url",
                    "statusPageUrl": "url",
                    "homePageUrl": "url",
                    "status": "UP"
                }
            ]
        },}
}

here is my config

check.response:
    status: [200, 201]
    json:
        - description: check status
          condition:
            equals:
              status: UP
  processors:
  - decode_json_fields:
      fields: ["applications"]
      process_array: false
      max_depth: 3
      target: ""
      overwrite_keys: false
      add_error_key: true

I am getting error message in the heartbeat. I want to verify the status of the field status which is nested for each application and also send the whole response to elastic search .

Thanks in advance

Hi @shani_angarkadu :slightly_smiling_face:

Please, share the error you are getting too.

The heartbeat json config won't work here because it doesn't understand arrays.

Heartbeat really isn't intended for this use case with multiple applications sharing an endpoint.

If you could have a URL per app, without the array (one status only in the body) heartbeat would work great.

1 Like

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