# Multiple Retention Policies for High vs Low Frequency Transactions

**URL:** <https://discuss.elastic.co/t/multiple-retention-policies-for-high-vs-low-frequency-transactions/175908>\
**Category:** APM\
**Created:** [April 8, 2019, 7:14pm UTC](https://discuss.elastic.co/t/multiple-retention-policies-for-high-vs-low-frequency-transactions/175908 "2019-04-08T19:14:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvisz-inf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dvisz-inf/32/42617_2.png) [@dvisz-inf](https://discuss.elastic.co/u/dvisz-inf)\
**Post date:** [April 8, 2019, 7:14pm UTC](https://discuss.elastic.co/t/multiple-retention-policies-for-high-vs-low-frequency-transactions/175908/1 "2019-04-08T19:14:35Z")

</div>

Hi all 🙂

I have a class of transactions which are very low frequency compared to most of the transactions I will be collecting data on via APM, and I'd like to keep this data longer than the high frequency data.

Is there a way to do this?

I am only just beginning to learn how to operationalize the data that APM is collecting, so maybe I am asking the wrong questions. Any advice welcome!

---

<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:** [April 9, 2019, 3:13am UTC](https://discuss.elastic.co/t/multiple-retention-policies-for-high-vs-low-frequency-transactions/175908/2 "2019-04-09T03:13:26Z")

</div>

Hi @dvisz-inf 🙂

> I have a class of transactions which are very low frequency compared to most of the transactions I will be collecting data on via APM, and I'd like to keep this data longer than the high frequency data.
> 
> Is there a way to do this?

It depends: do you know at ingestion time? Do you know from the transaction names (or some other properties? labels?) which data are more frequent than others?

One approach would be to route the data into different indices, say "apm-frequent-transactions" and "apm-infrequent-transactions". This can be done by modifying `output.elasticsearch.indices` in `apm-server.yml` to route the data based on the fields and values contained within. See [Configure the Elasticsearch output | APM User Guide [8.11] | Elastic](https://www.elastic.co/guide/en/apm/server/current/elasticsearch-output.html#_literal_indices_literal).

With the data in different indices, you can then create different ILM (Index Lifecycle Management) policies for each category. See [https://www.elastic.co/guide/en/apm/server/current/manual-ilm-setup.html](https://www.elastic.co/guide/en/apm/server/current/manual-ilm-setup.html).

---

<div class="post-metadata">

**Author:** ![dvisz-inf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dvisz-inf/32/42617_2.png) [@dvisz-inf](https://discuss.elastic.co/u/dvisz-inf)\
**Post date:** [April 9, 2019, 8:11pm UTC](https://discuss.elastic.co/t/multiple-retention-policies-for-high-vs-low-frequency-transactions/175908/3 "2019-04-09T20:11:10Z")

</div>

Yes, I know at ingest time. Or at least, the guess I have at ingest time is good enough!

Your solution seems perfect. Thanks!

---

<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:** [April 30, 2019, 4:11pm UTC](https://discuss.elastic.co/t/multiple-retention-policies-for-high-vs-low-frequency-transactions/175908/4 "2019-04-30T16:11:11Z")

</div>

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