Add multiple https API in watcher

Hi team,
I am able to send cluster health data using GET _cluster/health using below input and condition. Now in input section I want to use other two more APIs:

GET /_cat/allocation?v=true&s=node
GET _cat/nodes?v=true&s=name

Can you please help me to add these APIs in one input section so that i can share health report, host allocation details, and node hard disk usage in one email.

I am using below input and condition.

"input": {
    "http": {
      "request": {
        "scheme": "https",
        "host": "hostname",
        "port": 9200,
        "method": "get",
        "path": "_cluster/health",
        "params": {},
        "headers": {},
        "auth": {
          "basic": {
            "username": "elastic",
            "password": "test"
          }
        }
      }
    }
  },
  "condition": {
    "script": {
      "source": "return true;",
      "lang": "painless"
    }
  },

Hi Mangesh,

I would try to use the chain possibility:

"input": {
  "chain": {
    "inputs": [
      {
        "http1": {
          "request": {
            "scheme": "https",
            "host": "hostname1",
            "port": 9200,
            "method": "get",
            "path": "_cluster/health",
            "params": {},
            "headers": {},
            "auth": {
              "basic": {
                "username": "elastic",
                "password": "test"
              }
            }
          }
        },
        "http2": {
          "request": {
            "scheme": "https",
            "host": "hostname2",
            "port": 9200,
            "method": "get",
            "path": "_cluster/health",
            "params": {},
            "headers": {},
            "auth": {
              "basic": {
                "username": "elastic",
                "password": "test"
              }
            }
          }
        }
      }
    ]
  }
}

Now if the question is on, in the chain, how to get
GET /_cat/allocation?v=true&s=node
GET _cat/nodes?v=true&s=name

I never tried myself, can't help.

Hi @JohnJ_M ,
thanks for help on chain input. It is working now. i will check variable in some other blog

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