# Help: Format The Watcher Email Body Section

**URL:** <https://discuss.elastic.co/t/help-format-the-watcher-email-body-section/295565>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [January 27, 2022, 10:09am UTC](https://discuss.elastic.co/t/help-format-the-watcher-email-body-section/295565 "2022-01-27T10:09:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![appleyin1](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@appleyin1](https://discuss.elastic.co/u/appleyin1)\
**Post date:** [January 27, 2022, 10:09am UTC](https://discuss.elastic.co/t/help-format-the-watcher-email-body-section/295565/1 "2022-01-27T10:09:14Z")

</div>

Hi there:  
I'm currently using this code `{{ctx.payload.payload_result}}` in my email body to print out the health check status but the format is not ideal (see below), is there a way I can organize it nicely(see proposed output)? Thanks so much.

```auto
"payload_result": {
          "summary": {
            "unavailable": {
              "system1-health-check-status": [
                "system1-host"
              ],
              "system2-health-check-status": [
                "system2-host"
              ],
              "system3-health-check-status": [
                "system3-host"
              ],
              "system4-health-check-status": [
                "system4-host"
              ],
              "system5-health-check-status": [
                "system5-host"
            }
         }
      }

```

Proposed Output:

```auto
system1-health-check-status
 -system1-host

system2-health-check-status
 -system2-host

system3-health-check-status
 -system3-host

system4-health-check-status
 -system4-host

system5-health-check-status
 -system5-host
```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 8, 2022, 1:36pm UTC](https://discuss.elastic.co/t/help-format-the-watcher-email-body-section/295565/2 "2022-02-08T13:36:04Z")

</div>

You can loop through a list in your payload result and then do some formatting...

Can you share what you tried so far, because I am only seeing JSON here, which does not help too much from my perspective.

Thanks!

---

<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:** [March 8, 2022, 1:36pm UTC](https://discuss.elastic.co/t/help-format-the-watcher-email-body-section/295565/3 "2022-03-08T13:36:34Z")

</div>

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