# Reduce the number of elasticsearch indicies that my Django app creates with elastic-apm for Python

**URL:** <https://discuss.elastic.co/t/reduce-the-number-of-elasticsearch-indicies-that-my-django-app-creates-with-elastic-apm-for-python/189024>\
**Category:** APM\
**Tags:** python\
**Created:** [July 5, 2019, 7:06am UTC](https://discuss.elastic.co/t/reduce-the-number-of-elasticsearch-indicies-that-my-django-app-creates-with-elastic-apm-for-python/189024 "2019-07-05T07:06:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonasks](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@Jonasks](https://discuss.elastic.co/u/Jonasks)\
**Post date:** [July 5, 2019, 7:06am UTC](https://discuss.elastic.co/t/reduce-the-number-of-elasticsearch-indicies-that-my-django-app-creates-with-elastic-apm-for-python/189024/1 "2019-07-05T07:06:13Z")

</div>

I'd like to reduce the amount of indicies that the APM built in to our Django creates, or setting a custom index pattern. I haven't been able to find any setting to do that, and I've not been successful to send the logs to my Logstash server. I'm using the [elastic-apm python module](https://github.com/elastic/apm-agent-python), with minimal settings.  
Any suggestions?

**Kibana version** :  
7.0.0  
**Elasticsearch version** :  
7.0.0  
**APM Server version** :  
7.0.0  
**APM Agent language and version** :  
[elastic-apm](https://github.com/elastic/apm-agent-python) with Django 2.1.10. Python 3.7.

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
Elastic Cloud Enterprise

---

<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:** [July 5, 2019, 7:34am UTC](https://discuss.elastic.co/t/reduce-the-number-of-elasticsearch-indicies-that-my-django-app-creates-with-elastic-apm-for-python/189024/2 "2019-07-05T07:34:59Z")

</div>

Hi Jonas, welcome to the forum!

You can configure the index name(s) in the APM Server: [https://www.elastic.co/guide/en/apm/server/7.0/elasticsearch-output.html#index-option-es](https://www.elastic.co/guide/en/apm/server/7.0/elasticsearch-output.html#index-option-es).

What's the reason for reducing the number of indices? Is it because they are sparse, and you want to optimise the index/shard size? If that's the case, you may also be interested in ILM (Index Lifecycle Management) - support for this was added to the APM Server in 7.2: [https://www.elastic.co/guide/en/apm/server/current/ilm.html](https://www.elastic.co/guide/en/apm/server/current/ilm.html)

---

<div class="post-metadata">

**Author:** ![Jonasks](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@Jonasks](https://discuss.elastic.co/u/Jonasks)\
**Post date:** [July 5, 2019, 7:45am UTC](https://discuss.elastic.co/t/reduce-the-number-of-elasticsearch-indicies-that-my-django-app-creates-with-elastic-apm-for-python/189024/3 "2019-07-05T07:45:02Z")

</div>

Thanks, and thanks for the quick reply!

We'll bump the APM server to 7.2 and check that out today. The indicies are sparse and we want to optimise a little, as you said.

---

<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 26, 2019, 3:45am UTC](https://discuss.elastic.co/t/reduce-the-number-of-elasticsearch-indicies-that-my-django-app-creates-with-elastic-apm-for-python/189024/4 "2019-07-26T03:45:04Z")

</div>

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