# Unable to access payload \_source fields using Watcher foreach with rollup data

**URL:** <https://discuss.elastic.co/t/unable-to-access-payload-source-fields-using-watcher-foreach-with-rollup-data/221049>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [February 26, 2020, 1:53pm UTC](https://discuss.elastic.co/t/unable-to-access-payload-source-fields-using-watcher-foreach-with-rollup-data/221049 "2020-02-26T13:53:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![iorfix](https://avatars.discourse-cdn.com/v4/letter/i/9fc348/32.png) [@iorfix](https://discuss.elastic.co/u/iorfix)\
**Post date:** [February 27, 2020, 9:30am UTC](https://discuss.elastic.co/t/unable-to-access-payload-source-fields-using-watcher-foreach-with-rollup-data/221049/2 "2020-02-27T09:30:53Z")

</div>

I resolved the issue. Mustache is not able to access fields with a dot inside them. I added a transform action, where I changed the field name, and then logged it out.

```auto
  "transform": {
    "script": {
      "lang" : "painless",
      "inline": "ctx.payload.hits.hits.forEach(hit -> hit._source.service_name_terms_count = hit._source['service.name.terms._count']); return ctx.payload"
      }
  }

```

```auto
"text": "Found ##{{ctx.payload._id}}## at ##{{ctx.payload._source.service_name_terms_count}}##"

```

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-access-payload-source-fields-using-watcher-foreach-with-rollup-data/221049)._
