# How do I reference a field name that contains a dot in watcher logging action

**URL:** https://discuss.elastic.co/t/how-do-i-reference-a-field-name-that-contains-a-dot-in-watcher-logging-action/266614
**Category:** Elasticsearch
**Created:** [March 8, 2021, 10:37pm UTC](https://discuss.elastic.co/t/how-do-i-reference-a-field-name-that-contains-a-dot-in-watcher-logging-action/266614 "2021-03-08T22:37:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Emilio\_Vega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emilio_vega/32/85195_2.png) [@Emilio\_Vega](https://discuss.elastic.co/u/Emilio_Vega)
#### Post date: [March 8, 2021, 10:37pm UTC](https://discuss.elastic.co/t/how-do-i-reference-a-field-name-that-contains-a-dot-in-watcher-logging-action/266614/1 "2021-03-08T22:37:33Z")

</div>

An elastic template index got field names using dots ("property.name") and I am wondering if it is possible reference them using "ctx.payload.hits.hits.0.\_source" object.

I did some different attempts without success. I know that it works with properties without dots, like  
ctx.payload.hits.hits.0.\_source.@version.

Thank you.

---

<div class="post-metadata">

### Author: ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)
#### Post date: [March 8, 2021, 11:18pm UTC](https://discuss.elastic.co/t/how-do-i-reference-a-field-name-that-contains-a-dot-in-watcher-logging-action/266614/2 "2021-03-08T23:18:07Z")

</div>

AFAIK dots are not supported in elasticsearch field names.

> <https://github.com/elastic/elasticsearch/issues/15951>
>
> As part of the Great Mapping Refactoring (#8870), we had to reject field names containing dots (#12068), eg:
> { 
> "foo.bar": "val1",...

> <https://github.com/elastic/elasticsearch/pull/19937>

You may try using this

> **[Dot expander processor | Elasticsearch Reference \[7.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/dot-expand-processor.html)**

---

<div class="post-metadata">

### Author: ![Emilio\_Vega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emilio_vega/32/85195_2.png) [@Emilio\_Vega](https://discuss.elastic.co/u/Emilio_Vega)
#### Post date: [March 9, 2021, 4:03pm UTC](https://discuss.elastic.co/t/how-do-i-reference-a-field-name-that-contains-a-dot-in-watcher-logging-action/266614/3 "2021-03-09T16:03:53Z")

</div>

I don´t get it.  
I thought using Elastic Common Schema no problems couldn´t be arise.  
Maybe I didn´t understood the ECS meaning and its benefits.

---

<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: [April 6, 2021, 4:04pm UTC](https://discuss.elastic.co/t/how-do-i-reference-a-field-name-that-contains-a-dot-in-watcher-logging-action/266614/4 "2021-04-06T16:04:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)
#### Post date: [July 9, 2021, 3:19pm UTC](https://discuss.elastic.co/t/how-do-i-reference-a-field-name-that-contains-a-dot-in-watcher-logging-action/266614/5 "2021-07-09T15:19:41Z")

</div>

A workaround to access fields with dots in their name is to wrap them in a context, such as:

```auto
{{#ctx.payload.hits.hits.0._source}}{{property.name}}{{/ctx.payload.hits.hits.0._source}}

```
