﻿---
title: unit_count
description: The value of this setting will be used as a multiplier for unit. unit, unit_count, and optionally, epoch, are used by Curator to establish the moment...
url: https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_unit_count
products:
  - Elasticsearch
  - Elasticsearch Curator
---

# unit_count
<note>
  This setting is only used with the [age](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/filtertype_age) filtertype, or with the [space](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/filtertype_space) filtertype if [use_age](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_use_age) is set to `True`.
</note>

```yaml
 - filtertype: age
   source: creation_date
   direction: older
   unit: days
   unit_count: 3
```

The value of this setting will be used as a multiplier for [unit](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_unit).
[unit](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_unit), unit_count, and optionally, [epoch](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_epoch), are used by Curator to establish the moment in time point of reference with this formula:
```sh
point_of_reference = epoch - ((number of seconds in unit) * unit_count)
```

[`units`](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_unit) are calculated as follows:

| Unit      | Seconds   | Note                                 |                                      |     |
|-----------|-----------|--------------------------------------|--------------------------------------|-----|
| `seconds` | `1`       | One second                           |                                      |     |
| `minutes` | `60`      | Calculated as 60 seconds             |                                      |     |
| `hours`   | `3600`    | Calculated as 60 minutes (60*60)*    |                                      |     |
|           | `days`    | `86400`                              | Calculated as 24 hours (2460*60)*    |     |
|           | `weeks`   | `604800`                             | Calculated as 7 days (724*60*60)     |     |
| `months`  | `2592000` | Calculated as 30 days (30*24*60*60)* |                                      |     |
|           | `years`   | `31536000`                           | Calculated as 365 days (36524*60*60) |     |

If [epoch](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_epoch) is unset, the current time is used. It is possible to set a point of reference in the future by using a negative value for unit_count.
This setting must be set by the user or an exception will be raised, and execution will halt.
If this setting is used in conjunction with [unit_count_pattern](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/fe_unit_count_pattern), the configured value will only be used as a fallback value in case the pattern could not be matched. The value *-1* has a special meaning in this case and causes the index to be ignored when pattern matching fails.
<tip>
  See the [age filter documentation](https://www.elastic.co/elastic/docs-builder/docs/3028/reference/elasticsearch/curator/filtertype_age) for more information about time calculation.
</tip>