# Adding custom field in fields.yml in APM

**URL:** https://discuss.elastic.co/t/adding-custom-field-in-fields-yml-in-apm/245961
**Category:** APM
**Tags:** server
**Created:** [August 21, 2020, 8:35pm UTC](https://discuss.elastic.co/t/adding-custom-field-in-fields-yml-in-apm/245961 "2020-08-21T20:35:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Shubhangi](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Shubhangi](https://discuss.elastic.co/u/Shubhangi)
#### Post date: [August 21, 2020, 8:35pm UTC](https://discuss.elastic.co/t/adding-custom-field-in-fields-yml-in-apm/245961/1 "2020-08-21T20:35:53Z")

</div>

**Kibana version** : 7.8

**Elasticsearch version** : 7.8

**APM Server version** : 7.7

**APM Agent language and version** : Java 1.9.0

**Browser version** : chrome

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: download page(elastic site)

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
I'm trying to enable http.request.header and add http.request.header.Trackingid to fields.yml.

This is an excerpt of fields.yml:

```
        - name: request
         type: group
         fields:

          - name: method
            type: keyword
            description: >
              The http method of the request leading to this event.
            overwrite: true

          - name: headers
            type: group
            description: >
              The canonical headers of the monitored HTTP request.
            fields:

             - name: Trackingid
               type: keyword
               description: >
                 My trackingid header
               overwrite: true

```

Still I can't find http.request.header.Trackingid in index patterns-\> apm\* fields, so, that i can refresh and field and cache it in ES.

Apm-server.yml has:

**setup.template.overwrite: true**  
**setup.template.enabled: true**

And I restarted apm server.

This is how it looks in Discover:

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

And I can't find it in apm index:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d9c36edebbc6b43eab53eff6c44d7a7e29a7afb4.png)

What can I do to cache request.header field in ES? What am I doing wrong?  
Thanks!

---

<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: [August 24, 2020, 6:04am UTC](https://discuss.elastic.co/t/adding-custom-field-in-fields-yml-in-apm/245961/2 "2020-08-24T06:04:17Z")

</div>

Hi @Shubhangi,  
could you please have a look at a [previous discuss entry](https://discuss.elastic.co/t/no-cached-mapping-for-this-field-refresh-field-list-from-the-lanagement/236835/2) where we explained how to use the configuration option `setup.template.append_fields` and when templates generally get applied.  
Let me know if that helps.

---

<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: [September 14, 2020, 2:04am UTC](https://discuss.elastic.co/t/adding-custom-field-in-fields-yml-in-apm/245961/3 "2020-09-14T02:04:21Z")

</div>

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