# Add multiple https API in watcher

**URL:** <https://discuss.elastic.co/t/add-multiple-https-api-in-watcher/321033>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting, painless\
**Created:** [December 12, 2022, 1:44pm UTC](https://discuss.elastic.co/t/add-multiple-https-api-in-watcher/321033 "2022-12-12T13:44:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangeshmj1992](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mangeshmj1992](https://discuss.elastic.co/u/mangeshmj1992)\
**Post date:** [December 12, 2022, 1:44pm UTC](https://discuss.elastic.co/t/add-multiple-https-api-in-watcher/321033/1 "2022-12-12T13:44:08Z")

</div>

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.

```auto
"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"
    }
  },

```

---

<div class="post-metadata">

**Author:** ![JohnJ\_M](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@JohnJ\_M](https://discuss.elastic.co/u/JohnJ_M)\
**Post date:** [December 12, 2022, 2:48pm UTC](https://discuss.elastic.co/t/add-multiple-https-api-in-watcher/321033/2 "2022-12-12T14:48:13Z")

</div>

Hi Mangesh,

I would try to use the chain possibility:

```auto
"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.

---

<div class="post-metadata">

**Author:** ![mangeshmj1992](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mangeshmj1992](https://discuss.elastic.co/u/mangeshmj1992)\
**Post date:** [December 12, 2022, 3:03pm UTC](https://discuss.elastic.co/t/add-multiple-https-api-in-watcher/321033/3 "2022-12-12T15:03:43Z")

</div>

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

---

<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:** [January 9, 2023, 3:04pm UTC](https://discuss.elastic.co/t/add-multiple-https-api-in-watcher/321033/4 "2023-01-09T15:04:16Z")

</div>

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