# 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:** 1\
**Showing post:** 2

<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

---

_[View the full topic](https://discuss.elastic.co/t/how-to-send-number-of-shard-activeshard-reallocationg-shard-every-day-via-watcher/318180)._
