# Watcher output message

**URL:** https://discuss.elastic.co/t/watcher-output-message/227591
**Category:** Elasticsearch
**Created:** [April 11, 2020, 9:17am UTC](https://discuss.elastic.co/t/watcher-output-message/227591 "2020-04-11T09:17:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Silver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/silver/32/19894_2.png) [@Silver](https://discuss.elastic.co/u/Silver)
#### Post date: [April 11, 2020, 9:17am UTC](https://discuss.elastic.co/t/watcher-output-message/227591/1 "2020-04-11T09:17:16Z")

</div>

This is the output i am getting for my aggregation..

```
"aggregations": {
      "users": {
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 0,
        "buckets": [
          {
            "doc_count": 68,
            "ip": {
              "doc_count_error_upper_bound": 0,
              "sum_other_doc_count": 0,
              "buckets": []
            },
            "key": "-"
          },
          {
            "doc_count": 4,
            "ip": {
              "doc_count_error_upper_bound": 0,
              "sum_other_doc_count": 0,
              "buckets": [
                {
                  "doc_count": 4,
                  "key": "10.10.10.2"
                }
              ]
            },
            "key": "w33kstor"
          },
          {
            "doc_count": 4,
            "ip": {
              "doc_count_error_upper_bound": 0,
              "sum_other_doc_count": 0,
              "buckets": [
                {
                  "doc_count": 4,
                  "key": "10.10.10.3"
                }
              ]
            },
            "key": "looo"
          }

```

How can I get the count across to telegram? The IP seem to be displaying in a array when i try.. I need it to output as Username : IP : Count (based on doc\_count by IP)

```
  "webhook": {
    "scheme": "https",
    "host": "api.telegram.org",
    "port": 443,
    "method": "post",
    "path": "/bot1083222201[redacted]:--27vk/sendMessage",
    "params": {},
    "headers": {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    "body": "chat_id=-213321&text=Total requests\n{{#ctx.payload.aggregations.users.buckets}}{{key}}:{{doc_count}}:{{IP}}{{/ctx.payload.aggregations.users.buckets}} "
  }
}
```

---

<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: [May 9, 2020, 9:31am UTC](https://discuss.elastic.co/t/watcher-output-message/227591/2 "2020-05-09T09:31:28Z")

</div>

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