# Creating APM index in Elasticsearch based on event name in APM server 8.7.1

**URL:** <https://discuss.elastic.co/t/creating-apm-index-in-elasticsearch-based-on-event-name-in-apm-server-8-7-1/332811>\
**Category:** APM\
**Tags:** ilm-index-lifecycle-management, server\
**Created:** [May 8, 2023, 11:55am UTC](https://discuss.elastic.co/t/creating-apm-index-in-elasticsearch-based-on-event-name-in-apm-server-8-7-1/332811 "2023-05-08T11:55:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mralians](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mralians/32/120749_2.png) [@mralians](https://discuss.elastic.co/u/mralians)\
**Post date:** [May 8, 2023, 11:55am UTC](https://discuss.elastic.co/t/creating-apm-index-in-elasticsearch-based-on-event-name-in-apm-server-8-7-1/332811/1 "2023-05-08T11:55:15Z")

</div>

I upgraded APM from version 7.17 to 8.7.1. In the previous version, the APM index in Elasticsearch was based on this APM server configuration:

```auto
- index: "apm-%{[observer.version]}-%{[service.name]}-metric-%{+yyyy.MM.dd}"
  when.contains:
    processor.event: "metric"

```

The roll-over policy was based on this index name, but this configuration is no longer working in the newer version (8.7.1). Can anyone tell me how to create an APM index in Elasticsearch based on the APM client event name in APM server version 8.7.1?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [May 9, 2023, 1:43am UTC](https://discuss.elastic.co/t/creating-apm-index-in-elasticsearch-based-on-event-name-in-apm-server-8-7-1/332811/2 "2023-05-09T01:43:09Z")

</div>

@mralians in 8.x, APM Server writes documents to data streams with a specific format: `<type>-<dataset>-<namespace>`. At the moment, the only thing that can be customised is the namespace. Everything else is based on the data.

Custom application metrics are sent to service-specific data streams.

Can you tell us a little bit about your reasons for splitting indices by `service.name`? Is it so you can keep metrics for some services longer than others?

---

<div class="post-metadata">

**Author:** ![mralians](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mralians/32/120749_2.png) [@mralians](https://discuss.elastic.co/u/mralians)\
**Post date:** [May 9, 2023, 3:33pm UTC](https://discuss.elastic.co/t/creating-apm-index-in-elasticsearch-based-on-event-name-in-apm-server-8-7-1/332811/3 "2023-05-09T15:33:50Z")

</div>

In the previous version, I had APM indices based on the processor.name, for example, `apm-transaction-2022.03`. Based on this index name pattern, I could define rollover policies, which allowed me to obtain different APM indices based on the processor.name with different rollover policies.

can I achieve this in the APM Server version 8.x?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [May 10, 2023, 1:12am UTC](https://discuss.elastic.co/t/creating-apm-index-in-elasticsearch-based-on-event-name-in-apm-server-8-7-1/332811/4 "2023-05-10T01:12:09Z")

</div>

This is not currently possible. It is in our backlog, and there have been some recent changes to make it possible. I can't say when it will happen, but we do intend to add support for namespacing data streams.

---

<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:** [May 30, 2023, 9:12pm UTC](https://discuss.elastic.co/t/creating-apm-index-in-elasticsearch-based-on-event-name-in-apm-server-8-7-1/332811/5 "2023-05-30T21:12:46Z")

</div>

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