# Field not appearing in index after refreshing the field list

**URL:** <https://discuss.elastic.co/t/field-not-appearing-in-index-after-refreshing-the-field-list/185211>\
**Category:** APM\
**Tags:** rum, ui\
**Created:** [June 11, 2019, 2:04pm UTC](https://discuss.elastic.co/t/field-not-appearing-in-index-after-refreshing-the-field-list/185211 "2019-06-11T14:04:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henry\_Blyth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henry_blyth/32/47875_2.png) [@Henry\_Blyth](https://discuss.elastic.co/u/Henry_Blyth)\
**Post date:** [June 11, 2019, 2:04pm UTC](https://discuss.elastic.co/t/field-not-appearing-in-index-after-refreshing-the-field-list/185211/1 "2019-06-11T14:04:15Z")

</div>

I'm using `@elastic/apm` in a JavaScript client to send errors to Elastic, via `.captureError(err)`. I've added a custom property `status` to the error to send the status code of a http response.

I can see the status appearing in the events as `context.status` (below), but I cannot make queries on it as it's not in the index.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/9/59a6a87ea0a30d23fc3b18cd27edd75464d43b75.png)

I followed the tooltip instructions, but the field is not being added to the index. We've refreshed it several times, without errors: I've looked in the devtools console and network tabs and nothing is erring. Also the response from `/api/index_patterns/_fields_for_wildcard` does not contain the new field. I've refreshed several times today, as has my admin, with no luck.

I'd really like to get it into the index so I can monitor for status codes \>=400. Is there anything I can do? Is it an asynchronous process that might take some time to complete?

Thanks,  
Henry

 ![elastic-field-refresh-bug](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2a0f04ea76cae13c8e3f9a19a6579e4ed5520ce1.gif)

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [June 12, 2019, 2:12pm UTC](https://discuss.elastic.co/t/field-not-appearing-in-index-after-refreshing-the-field-list/185211/2 "2019-06-12T14:12:18Z")

</div>

Hi and welcome to the forum 🎉

The problem is that `context` is explicitly mapped as not indexed in the Elasticsearch mapping. In order to add a custom indexed property, you can use the [`addTags`](https://www.elastic.co/guide/en/apm/agent/js-base/current/transaction-api.html#transaction-add-tags) API to do that.

When using version 6.x of the stack, the property would be stored under `tags.status`, for example. In version 7.x of the stack, the property is stored as `labels.status`.

I hope 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:** [July 10, 2019, 2:17pm UTC](https://discuss.elastic.co/t/field-not-appearing-in-index-after-refreshing-the-field-list/185211/3 "2019-07-10T14:17:18Z")

</div>

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