# ES Index Name based on global\_labels

**URL:** <https://discuss.elastic.co/t/es-index-name-based-on-global-labels/228692>\
**Category:** APM\
**Tags:** server\
**Created:** [April 19, 2020, 2:51am UTC](https://discuss.elastic.co/t/es-index-name-based-on-global-labels/228692 "2020-04-19T02:51:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devopsify](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@devopsify](https://discuss.elastic.co/u/devopsify)\
**Post date:** [April 19, 2020, 2:51am UTC](https://discuss.elastic.co/t/es-index-name-based-on-global-labels/228692/1 "2020-04-19T02:51:55Z")

</div>

I am trying to dynamically generate the apm indice based on `global_labels` set in the apm agent, what's the best way to do it? I've tried ingest pipeline with script processor, I feel like it's over complicated any simpler way to do it?

The final index looks like `apm-demo-0123456-metrics-2020.04.18`

```auto
    "labels": {
      "app_owner": "0123456",
      "app_family": "demo"
    },

```

---

<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 9, 2020, 10:51pm UTC](https://discuss.elastic.co/t/es-index-name-based-on-global-labels/228692/2 "2020-05-09T22:51:57Z")

</div>

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