# How to send number of shard , activeshard, reallocationg shard every day via watcher

**URL:** <https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [November 4, 2022, 11:09am UTC](https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180 "2022-11-04T11:09:50Z")\
**Posts on this page:** 5\
**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:** [November 4, 2022, 11:09am UTC](https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180/1 "2022-11-04T11:09:50Z")

</div>

Hello team,  
I need to send email every day with below status. can i know how i can achieve this using watcher.

```
Kibana Health check for **Todays Date** is **Green / Red /Yellow**.

```

PFA for detail log ingestion and cluster status report

**Cluster Name: ABC**  
number\_of\_data\_nodes 12  
active\_primary\_shards 4567  
active\_shards 9678  
relocating\_shards 0  
initializing\_shards 0  
unassigned\_shards 0  
delayed\_unassigned\_shards 0  
number\_of\_pending\_tasks 0  
active\_shards\_percent\_as\_number 100

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [November 4, 2022, 5:49pm UTC](https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180/2 "2022-11-04T17:49:43Z")

</div>

Something like this:

```auto
POST _watcher/watch/_execute
{
  "watch": {
    "trigger": {
      "schedule": {
        "interval": "1d"
      }
    },
    "input": {
      "http": {
        "request": {
          "scheme": "https",
          "host": "mycluster.es.northamerica-northeast1.gcp.elastic-cloud.com",
          "port": 9243,
          "method": "get",
          "path": "_cluster/stats",
          "headers": {},
          "auth": {
            "basic": {
              "username": "elastic",
              "password": "xxxxxx"
            }
          }
        }
      }
    },
    "condition": {
      "script": {
        "source": "return true;"
      }
    },
    "actions": {
      "displayResults": {
        "logging": {
          "level": "info",
          "text": """
             cluster name: {{ctx.payload.cluster_name}}
             number_of_hot_data_nodes: {{ctx.payload.nodes.count.data_hot}}
             active_primary_shards : {{ctx.payload.indices.shards.primaries}}
             """
        }
      }
    }
  }
}

```

and also see example here for some more advanced calculations, etc.

> [@Add the data from a table in a watcher](https://discuss.elastic.co/t/add-the-data-from-a-table-in-a-watcher/317689):
>
> Hi All, We are able to generate data in a tabular format through a watcher IndexName StoreSize(in MB) DocumentCount index1 23 220 index-2 20 129 index-3 26 178 Is there any way in which we could add the total Store size and total document count separately and print that in the Watcher mail? Regards, Nalin

---

<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:** [December 2, 2022, 5:29pm UTC](https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180/3 "2022-12-02T17:29:04Z")

</div>



---

<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, 11:04am UTC](https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180/4 "2022-12-12T11:04:17Z")

</div>

Hi @richcollier ,  
Thanks for your confirmation. Can you please help me out for variable name for below fields.

**GET \_cat/nodes?v=true&s=name** : ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name

**GET /\_cat/allocation?v=true&s=node** : shards disk.indices disk.used disk.avail disk.total disk.percent host ip node

---

<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, 11:04am UTC](https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180/5 "2023-01-09T11:04:32Z")

</div>

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