# APM transaction.custom

**URL:** <https://discuss.elastic.co/t/apm-transaction-custom/373600>\
**Category:** APM\
**Tags:** nodejs, server\
**Created:** [January 23, 2025, 7:49pm UTC](https://discuss.elastic.co/t/apm-transaction-custom/373600 "2025-01-23T19:49:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spaulovich](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@spaulovich](https://discuss.elastic.co/u/spaulovich)\
**Post date:** [January 23, 2025, 7:49pm UTC](https://discuss.elastic.co/t/apm-transaction-custom/373600/1 "2025-01-23T19:49:34Z")

</div>

I've seen that using OTEL stores transaction.custom as a flattened field, where using an elastic agent stores the content to unmapped fields.

I'm using elastic agents and would like to store transaction.custom as a flattened field. Mapping didn't work, ingest pipeline processor "convert" doesn't support flattened.

Any guidance on how I can store transaction.custom as a flattened field, without using OTEL.

---

<div class="post-metadata">

**Author:** ![Kostya\_Masliuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kostya_masliuk/32/137867_2.png) [@Kostya\_Masliuk](https://discuss.elastic.co/u/Kostya_Masliuk)\
**Post date:** [January 24, 2025, 2:26am UTC](https://discuss.elastic.co/t/apm-transaction-custom/373600/2 "2025-01-24T02:26:53Z")

</div>

Hello @spaulovich, could you please explain in more details the OTEL setup which you're referring to?

> [@spaulovich](#):
>
> I've seen that using OTEL stores transaction.custom as a flattened field

In general for a setup with APM Agent to APM Server, you should be able to just update the mapping using the following requests to change the mappings.

```auto
PUT _component_template/traces-apm@custom
{
  "template": {
    "mappings": {
      "properties": {
        "transaction.custom": {
          "type": "flattened"
        }
      }
    }
  }
}

```

```auto
POST traces-apm-default/_rollover

```

---

<div class="post-metadata">

**Author:** ![spaulovich](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@spaulovich](https://discuss.elastic.co/u/spaulovich)\
**Post date:** [January 24, 2025, 6:40pm UTC](https://discuss.elastic.co/t/apm-transaction-custom/373600/3 "2025-01-24T18:40:46Z")

</div>

Thanks Kostya\_Masliuk!

I forgot rollover for it to take effect.
