# Unable to add tags-field to APM documents through ingest pipeline

**URL:** <https://discuss.elastic.co/t/unable-to-add-tags-field-to-apm-documents-through-ingest-pipeline/342580>\
**Category:** APM\
**Tags:** rum, server\
**Created:** [September 8, 2023, 7:26am UTC](https://discuss.elastic.co/t/unable-to-add-tags-field-to-apm-documents-through-ingest-pipeline/342580 "2023-09-08T07:26:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apt-get\_install\_skil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apt-get_install_skil/32/115156_2.png) [@apt-get\_install\_skil](https://discuss.elastic.co/u/apt-get_install_skil)\
**Post date:** [September 8, 2023, 7:26am UTC](https://discuss.elastic.co/t/unable-to-add-tags-field-to-apm-documents-through-ingest-pipeline/342580/1 "2023-09-08T07:26:12Z")

</div>

I'm implementing some ingest pipelines to enrich our APM/RUM data. Works fine so far. However, I noticed that when I try to add a `tags` field, neither Kibana nor Elasticsearch can properly handle it. For example a very basic failure processor:

```auto
{
  "append": {
    "field": "tags",
    "value": ["_ingest_pipeline_error"]
  }
}

```

The "visual" representation of the documents in Kibana's discovery does not show this field. However, clicking on the JSON tab reveals that the `tags` field is present.

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

Filtering on the field's existence results in an empty response. I also refreshed the index via the `_refresh` api multiple times but nothing seems to work. I noticed that there is no explicit mapping for the `tags` field in the index but this shouldn't be a problem, should it? The same processor works fine when the target field is `labels` (which has a mapping).

Stack version: 8.6.1 (on-prem)

Kind regards

---

<div class="post-metadata">

**Author:** ![kyungeunni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kyungeunni/32/125539_2.png) [@kyungeunni](https://discuss.elastic.co/u/kyungeunni)\
**Post date:** [September 12, 2023, 7:10am UTC](https://discuss.elastic.co/t/unable-to-add-tags-field-to-apm-documents-through-ingest-pipeline/342580/2 "2023-09-12T07:10:42Z")

</div>

Hi @apt-get_install_skil,

Sorry for getting back to you late!

Dynamic mapping is disabled for `traces-apm-*` and `traces-apm.rum-*` so mapping should be configured for a custom field.

I reproduced your case in my local environment without the mapping. Then I updated the component template to have mapping for the `tags` field for the targeted datastream and I could see that all works fine.

It should work as expected once you add the mapping for `tags` field in the [@custom template](https://www.elastic.co/guide/en/apm/guide/current/custom-index-template.html#index-template-view). For example, for `traces-apm`:

```auto
PUT _component_template/traces-apm@custom
{
  "template": {
    "mappings": {
      "properties": {
        "tags": {
          "type": "keyword"
        }
      }
    }
  }
}

```

Also, be sure you [rollover](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/indices-rollover-index.html) to create a new write index for the data stream as the changes do not apply retroactively to existing indices.

Hope this helps.

Kyungeun

---

<div class="post-metadata">

**Author:** ![apt-get\_install\_skil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apt-get_install_skil/32/115156_2.png) [@apt-get\_install\_skil](https://discuss.elastic.co/u/apt-get_install_skil)\
**Post date:** [September 12, 2023, 7:44am UTC](https://discuss.elastic.co/t/unable-to-add-tags-field-to-apm-documents-through-ingest-pipeline/342580/3 "2023-09-12T07:44:40Z")

</div>

Hey Kyungeun,

thanks for your reply!

Yes, makes perfect sense...just didn't expect that dynamic mapping is disabled even for the `tags` field. In my mind this is a "standard" field just like `labels`.

But thanks for the clarification.

Regards,  
Lukas

---

<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:** [October 10, 2023, 7:45am UTC](https://discuss.elastic.co/t/unable-to-add-tags-field-to-apm-documents-through-ingest-pipeline/342580/4 "2023-10-10T07:45:30Z")

</div>

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