# No cached mapping for this field.Refresh field list from the lanagement

**URL:** https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835
**Category:** APM
**Created:** [June 12, 2020, 6:49am UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835 "2020-06-12T06:49:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)
#### Post date: [June 12, 2020, 6:49am UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/1 "2020-06-12T06:49:21Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/3/7/37fa13b2f27aac76aaee0d4e5cb461f6faa75efc.png)

I tried "Management -\> Index Patterns and hit Refresh button",but it didn't work.

I updated the fields.yml http field of apmserver, but it is still useless.

apmserver: 7.6.2  
ELK: 7.4.2

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5bd0bea58ea0564db608ca7f47f8d6d39d1cd94c.png)

---

<div class="post-metadata">

### Author: ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)
#### Post date: [June 12, 2020, 8:24am UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/2 "2020-06-12T08:24:56Z")

</div>

Hi @wajika,  
instead of directly changing the `fields.yml` you can add additional fields to your mapping via configuring [`setup.template.append_fields`](https://www.elastic.co/guide/en/apm/server/current/configuration-template.html) in the `apm-server.yml`. If you want to enable `dynamic` for `http.request.headers` you could configure:

```auto
setup.template.append_fields:
- name: http.request.headers
  type: group
  dynamic: true

```

Be aware though that a template only gets applied to newly created indices. If the index existed before you changed the template, the changes won't be applied to this index. You can check if the template mapping has been applied by calling `GET apm-*transaction/_mapping`.

---

<div class="post-metadata">

### Author: ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)
#### Post date: [June 13, 2020, 1:42am UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/3 "2020-06-13T01:42:38Z")

</div>

After I use setup.template.append\_fields, the transaction index no longer appears.  
I deleted all apm indexes and then restarted apmserver.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e25bc93e9b4dd316e51a3bc255e7b82e560bd377.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/0/90dbbe551ef74f62c90e4cdbf2642288be3da3a9.png)  
apmserver log  
[https://paste.ubuntu.com/p/jbYPcgXCzp/](https://paste.ubuntu.com/p/jbYPcgXCzp/)

es log  
[https://paste.ubuntu.com/p/cMfNjMCxJx/](https://paste.ubuntu.com/p/cMfNjMCxJx/)

---

<div class="post-metadata">

### Author: ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)
#### Post date: [June 15, 2020, 6:33am UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/4 "2020-06-15T06:33:09Z")

</div>

> [@simitt](#):
>
> ```auto
> setup.template.append_fields:
> - name: http.request.headers
> type: group
> dynamic: true
> 
> ```

setup.template.append\_fields:

- name: http.request.headers \>\>\> If I write http.request.headers can it affect the http.request.body.original field (depth four levels)  
type: group  
dynamic: true

---

<div class="post-metadata">

### Author: ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)
#### Post date: [June 15, 2020, 6:57am UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/5 "2020-06-15T06:57:18Z")

</div>

```auto
ERROR	pipeline/output.go:100	Failed to connect to backoff(elasticsearch(xxx)): Connection marked as failed because the onConnect callback failed: resource 'apm-7.6.2-span' exists, but it is not an alias

```

This error from your `apm-server.log` file suggests that the `apm-7.6.2-span` exists as index, while it should be a write alias. You can find more information about when this error happens in [Issues#3698](https://github.com/elastic/apm-server/issues/3698).

> If I write http.request.headers can it affect the http.request.body.original field (depth four levels)

You can specify an array of fields to append to the template. Every field definition will only be applied to the specified group of fields. Therefore `http.request.headers` will not impact `http.request.body.original`, but only everything nested under `http.request.headers`.  
In case you would like to index the body, you could for example specify it as multifield:

```auto
setup.template.append_fields:
  - name: http.request.headers
    type: group
    dynamic: true
  - name: http.request.body.original
    type: keyword
    ignore_above: 1024
    multi_fields:
      - name: text
        type: text

```

---

<div class="post-metadata">

### Author: ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)
#### Post date: [June 17, 2020, 3:00am UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/6 "2020-06-17T03:00:26Z")

</div>

Thank you for the method @simitt

---

<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: [July 7, 2020, 11:03pm UTC](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/7 "2020-07-07T23:03:30Z")

</div>

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